COAL Assignment 02
COAL Assignment 02
COAL Assignment 02
Assignment 2
Question 1: Write an assembly program to count the total number of digits in a string. [10 marks]
Question 2: Convert the following C++ code into assembly language. [10 marks]
int t=1,
k=2;
while(t!=11)
cout<<k*t<<endl;
t=t+1;
}
Question 3: [10 marks]
Write an assembly program that take a string input from user and ask user for a specific character to be
searched for. Display the count of that character in a string.
Write an assembly language program to make a CV of your personal information and save that in
memory. Paste the screenshots of all the entries that you save in memory. The better the CV, the more
marks you get
Write an assembly program to reverse an integer number. Your program should also find the sum of
digits in that integer number. Store sum and reverse number in a separate variable. For Example, if the
number is 1234, its reverse will be 4321 and sum=10
Input a list of Strings e.g ['Ali', 'Usman', 'Abdullah'] You have to sort them in ascending order. (Take Input
a size of the array)
To decide which string is greater use the following algorithm. Multiply the ASCII of each character with
its index and add them. The string with a higher value would be greater.
Write an assembly code that store the most frequently occurring element of an array in a variable. For
Example, if an array is [1, 2, 3, 1, 4, 2, 2], your method should return 2.
Question 9: [20 marks]
Write a program that finds out whether there is a given character in a string. If the character is present
in the string, display a proper message along with the index of that character. If the character occurs at
multiple positions, display the index of first occurrence.
Example:
Character: a
Best of Luck