You are on page 1of 3

C ASSIGNMENT

1. Write a program to implement the use of all arithmetic operators. (+,-,*,/,%) 2. Write a program to add 5 subject marks and print the total and average of the marks along with their roll numbers.
3. Write a program to swap two numbers using a third variable. 4. Write a program to swap two numbers without using the third variable USE OF IF-ELSE 5. Write a program to calculate commission for the salesman. The commission is calculated according to the following rates: Sales Commission rate 30001 15% onwards 22001-30000 10% 12001-22000 7% 5001-12000 3% 0-5000 0% 6. Write a program to input a character and to print whether a given character is an alphabet, digit or any other character.

7. Write a program to calculate different discounts given on different amount of purchases. Amount Discount given >= 10000 10% >= 7000 5% >= 3000 2% < 3000 0% 8. Write a program to print the different Grades depending upon the percentage of marks obtained. Percentage Grades >= 90% O >= 80% E >= 70% A >= 60% B >= 50% C >= 40% D < 40% F 9. Write a program to display a menu regarding rectangle operations (area, perimeter, diagonal) and
perform according to users response. (use switch case) 10. Write a program to find out whether a year is a leap year or not. 11. Write a program to find the root of a quadratic equation . 12. Write the above programs (1 and 2) using logical operator (&&). 13. Write programs using different logical operators (&&, || , ! ) 14. Write the above programs (2) using switch case. 15. Write any program to show the use of conditional/ ternary operator. 16. Write a program to find the greatest & smallest of numbers taken from user. 17. Write a program to find the LCM & GCD of given numbers taken from user. 18. Write a program to print all the characters and values between the range -128 and 127. USE OF LOOPS 19. Write a program to detect a number is prime or not. 20. Write a program to detect a number is armstrong number or not. 21. Write a program to detect a number is perfect number or not. 22. Write a program to find the sum of the digits of the number. 23. Write a program to find the reverse of the number.

24. Write a program to detect a number is a palindrome number or not. 25. Write a menu driven program to detect a number is prime, perfect, armstrong or palindrome or not. (use switch case) 26. Write a program to detect a number is a Krishnamurthy number or not. 27. Write a program to find all the prime factors of a number 28. Write a program to find all the prime numbers between a given range. 29. Write a program to find all the perfect numbers between a given range. 30. Write a program to find all the armstrong numbers between a given range. 30. Write a program to convert decimal to binary , octal or hexadecimal ( without using array ) . 31. Write separate programs to print the patterns :

a) * ** *** **** d) **** *** ** * g) * *** ***** *** * 1 212 32123 4321234

b)

* ** *** **** * *** ***** *******

c) **** *** ** * f) ***** *** * i) 1 22 333 4444

e)

h) 1 12 123 1234 k) 1 11 121 1331 14641

j)

( PASCALS Triangle

32. Write a program to get the sum of the series :

a. 1 + 1 + 1 + 1 + (1+2) (1+2+3) (1+2+3+4) b. 1 - 3/2 + 5/6 - 7/24 + 9/120 (take n from user) c. 1*22 + 2* 32 + 3* 42 + .. + 10* 112 d. x+ x2/2 + x3/4 + x4/7 + x5/11 + x6/16+ (take n from user)
ARRAYS , FUNCTIONS ( RECURSION ) . 33.Write a program which performs addition of subject marks and finds the average of each student against each roll number . 34. Write a program for bubble sorting of n numbers taken from the user . 35. Write a program to convert a decimal number to a binary, octal or hexadecimal or vice versa . 36. Write a program for addition , subtraction or multiplication of 2 matrices . (use switch case) 37. Write a program for finding the sum of elements for each column or row of a given matrix .

38. Write a program to show the multiplication table .

STRINGS 1. Write a program to implement the strlen( ) , strcpy( ) , strrev( ) , strcmp( ) , strcat( ). 2. Write a program to check whether a string is a palindrome string or not . 3. Write a program for sorting names in alphabetical order . 4. Write a program to count the no of words in a given lines of text. 5. Write a program to count the no. of consonants, vowels, upper case letters, lower case letters in a text.

POINTERS, STRUCTURES

1. Write a program to swap two values using pass by value , pass by address. 2. A class consists of 50 students . Each student has roll , name , marks of 5 subjects of a semester . Write a program to find all the students who has got more than 60% marks . Print their roll , name and % of marks they got in that semester .

You might also like