C WORKOUTS
Basic program: 14. Write a C program to input basic salary of an
1. To print the name employee and calculate its Gross salary according to
2. Addition of two numbers following:
3. Subtraction Basic Salary <= 10000 : HRA = 20%, DA = 80%
4. Multiplication Basic Salary <= 20000 : HRA = 25%, DA = 90%
5. Division Basic Salary > 20000 : HRA = 30%, DA = 95%
6. Area of circle(3.14*r*r) 15. Write a C program to check whether a number is
7. Area of Trapezoid(0.5*(b1+b2)*h) divisible by 5 and 11 or not.
8. Area of sphere(4*3.14*r*r) Looping programs:
9. Surface area of cylinder(2*3.14*r*h) 1. Print 1 to 10
10. Quadratic equation(a*x*x+b*x+c) 2. Print 10 to 1
11. Write a C program that takes hours and minutes as 3. Print odd numbers between 1 to 10
input, and calculates the total number of minutes. 4. Print even numbers between 1 to 10
12. Write a program that converts Centigrade to 5. Sum of n numbers
Fahrenheit(C×(9/5)+32). 6. Sum of all even numbers
13. Cube of a number 7. Sum of all odd numbers
14. Swapping with temporary variable 8. Factorial of a number
15. Swapping without temporary variable 9. Power of any number
Conditional statements: 10. Multiplication table of any number
1. Odd/even 11. Prime numbers
2. Largest of two numbers 12. Fibonacci
3. Eligible for voting(age above 18) 13. Sum of first and last digit
4. Largest of three numbers 14. Product of all digits
5. Char is vowel or consonant 15. Find reverse of any no
6. Input week days display week 16. Palindrome
name(1=Monday,2=Tuesday…..7=Sunday using 17. Armstrong no
else if and switch) Patterns:
7. Leap year
8. Input month number display number of days
9. Check char is uppercase/lowercase
10. Profit /loss
11. Write a C program to input marks of five subjects
Physics, Chemistry, Biology, Mathematics and
Computer. Calculate percentage and grade according
to following:
Percentage >= 90% : Grade A
Percentage >= 80% : Grade B
Percentage >= 70% : Grade C
Percentage >= 60% : Grade D
Percentage >= 40% : Grade E
Percentage < 40% : Grade F
12. Perform arithmetic operations
13. Write a C program to input electricity unit charges
and calculate total electricity bill according to the
given condition:
For first 50 units Rs. 0.50/unit
For next 100 units Rs. 0.75/unit
For next 100 units Rs. 1.20/unit
For unit above 250 Rs. 1.50/unit
An additional surcharge of 20% is added to the bill
C WORKOUTS
1D array: Functions:
1. Sum of all array elements 1. Write a c program using wop wor to find the number
2. Copy elements from one array to another is strong number or not.
3. Find particular element present /not 2. Using wp wr find given number is Armstrong number.
4. Replace particular element by another element 3. Using wop wr find given number is prime or not.
5. Identify duplicates of the element 4. Using wp wr find given number is odd or even.
6. Delete particular element from array 5. Factorial using recursion
7. Merge two array into another array 6. Sum of array elements using recursion
8. Put odd in one array even in another 7. Sum of digits using recursion
9. Ascending order Files:
10. Descending order
1. Write a program in C to create and store information
11. Min max element
in a text file.
2D Array: 2. Write a program in C to read an existing file.
1. Matrix addition 3. Write a program in C to store the value in array from
2. Subtraction the file.
3. Multiplication 4. Write a program to delete a particular number in the
4. Sum of diagonal elements string from the file and store it back in the file.
5. Transpose 5. Write a program in C to copy a file in another file.
STRING:
1. Write a program in C to find the length of a string
without using library function.
2. Write a program in C to separate the individual
characters from a string.
3. Write a program in C to print individual characters of
string in reverse order.
4. Write a program in C to count the total number of words
in a string.
5. Write a program in C to compare two string without
using string library functions.
6. Write a program in C to count total number of alphabets,
digits and special characters in a string.
7. Write a program in C to copy one string to another string.
8. Write a program in C to count total number of vowel or
consonant in a string.
9. Write a C program to sort a string array in ascending
order
10. Write a C program to check whether a given substring is
present in the given string
11. Write a program in C to read a sentence and replace
lowercase characters by uppercase and vice-versa.
12. Write a program in C to find the largest and smallest word
in a string
13. Write a program in C to split string by space into words.