Assignment for 2DRCS1 AND 1DRCS2
1. Define strlen function (i.e write the function body of strlen)
2. Define the strcmp function and the strncmp function
3. Define strcpy function and the strncpy function
4. Define strcat function and the strncat function
5. Write a program to store the ages of six of your friends in a single array. Store each of the six ages using the assignment operator. print the ages on the screen
6. Write a C++ program that accepts 10 integers from the user and finally displays the smallest value and the largest value.
7. Write a program that accepts ten different integers from the user and display these numbers after sorting them in increasing order.
8. Write a program to store six of your friend’s ages in a single array. Assign the ages in a random order. print the ages, from low to high, on-screen
9. Modify the program on Q8 to print the ages in descending order.
10. Write a C++ program that calculates the letter grades of 20 students. The program should accept the mid result and the final result from the students. Use the appropriate validity
11. Write a C++ program that has two functions to Binary and toDecimal. The program should display a menu prompting the user to enter his choice. If the user selects to Binary, then the function should accept a number in base ten and displays the equivalent binary representation. The reverse should be done if the user selects toDecimal.
12. Develop a C++ program that accepts a word from the user and then checks whether the word is palindrome or not. (NB a word is palindrome if it is readable from left to right as well as right to left).
13. Write a C++ program that accepts a word from the user and then displays the word after reversing it.
14. Develop a C++ program that accepts the name of a person and then counts how many vowels the person’s name have.
15. Modify the question in Q14 in such a way that it should replace vowel characters with * in the person name.
16. Write a program in C++ which read a three digit number and generate all the possible permutation of numbers using the above digits. For example n = 123 then the permutations are-
123, 213, 312, 132, 231, 321
17. Write a program which read a set of lines until you enter #.
18. Write a program which read two matrixes and then print a matrix which is addition of these two matrixes.
19. Write a program which reads two matrix and multiply them if possible
20. Write a program which reads a 3 x 2 matrix and then calculates the sum of each row and store that in a one dimension array.b