Labsheet
Labsheet
Labsheet
4. Write a program which reads any two numbers and displays the largest one
using ternary operator.
5. Write a program to check whether the given number is odd or even.
6. Write a program which reads cost price & selling price and determine whether
there is profit or loss.
7. Write a program to check whether the given number is divisible by 5 but not by 7
or not.
8. Write a program to check whether the given number is Armstrong or not. [An ‘n’
digit number is said to be an Armstrong number if sum of nth power of each
digit is equal to the number itself. Eg 153 = (1 * 1 * 1) + (5 * 5 * 5) + (3 * 3 *3)]
9. Write a program to generate the following output
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
10. Write a c program to generate a Fibonacci series 1,1,2,3,5,8………….. upto 10 th
term.
11. Write a program to add any two matrixes.
12. Write a program to find the transpose of given matrix.
13. Write a program to multiply two 3 × 3 matrix.
14. Write a program to find whether the given string is palindrome or not.
15. Write a program to sort the name of students from the given array in
alphabetical order.
16. Write a program that converts the case of characters of the given string.
17. Write a program using user defined function to check whether the given number
is positive, negative or zero. (Function must return a value).
18. Write a function to find the factorial of any given number using recursion.
19. Write a program using user defined function to find the average of five numbers
given by the user without passing parameters.
20.