SOOPRO Pathshala provides CProgramming Exercises
SOOPRO Pathshala Exercises
1. Write a program to print your full name.
2. Write a program to print an integer entered by the user.
3. Write a program to print the sum of 23 and 43.
4. Write a program to print average of two integer(taking input from user).
5. Write a program to print sum of three float numbers and its average.(Taking numbers from user).
6. Write a program to find average of four long numbers.
7. Write a program to find sum of three double number.
8. Write a program to multiply two flaoting-point numbers.
9. Write a program to convert inches to yard, feet and centimeter(taking values of inches from user).
10. Write a program to convert Kilometer per hour to Miles per hour.(Taking input as 25kmph).
11. Write a program to calculate compound interest and simple interest(Taking p,r,t from user).
12. Write a program to find square and square root of 7 and 14.(Using float data type for square root).
13. Write a program to find area of square whose diagonal is 6√2.
14. Write a program to find area and cicumference of circle.(Taking r=7.36)
15. Write a program to find the area and perimeter of rectangle.(Taking value of l and b from user.)
16. Write a program to calculate the volume of sphere.(Input the radius of sphere is 6).
17. Write a program to calculate the volume of cube.(Input the size of cube is 5).
18. Write a program to calculate the volume of cylinder.(Input radius and height is 6 and 8).
19. Write a program to find area any triangle using Heron's Formula.(Taking the lengths of triangle from user).
20. Write a program to find the third angle of triangle.(Input two angles are 85 and 63 degree).
21. Write a program to compute the specified expressions and print the output. Expression : (25.5*3.5-3.5*3.5)/(40.5-4.5) [Answer : 2.13889]
22. Write a program to find distance travelled by a motorbike when its runs on 90kmph for 2.3 hr.
23. Write a program to convert Celsius to Farenheit.(Taking input C=35)
24. Write a program to convert Kelvin to Farenheit.(Taking input K=300)
25. Write a program to convert Celsius to Kelvin.(Taking input C=0)
SOOPRO Pathshala Exercises
1. Write a program that reads a number in inches and converts it to meters.
2.Write a program to convert minutes into years and days.
3.Write a program that prints the current time in GMT.
4.Write a program to accept and display your name.
5. Write a program to accept and display salary in float.
6.Write a program to accept and display your id.
7.Write a program that takes two integer numbers and print sum of numbers.
8.Write a program that takes three float numbers and print sum of numbers.
9.Write a program to print square of any number.
10.Write a program to print cube of any numbrer.
11.Write a program that reads a number and displays the square, cube, and fourth power.
12.Write a program that accepts two integers from the user and prints the sum, the difference, the product, the average, the division and the remainder.
13.Write a program to concatenate first and last name by user input.
14.Write a program to print sum of one float and one integer number.
15.Write a program to print sum of one long and one double number.
SOOPRO Pathshala Exercises
1. Write a program to find maximum between two numbers using conditional operator.
2. Write a program to find maximum between three numbers using conditional operator.
3. Write a program to check whether a number is even or odd using conditional operator.
4. Write a program to check whether a number is even or odd using conditional operator.
5. Write a program to check whether year is leap year or not using conditional operator.
6. Write a program to check whether character is an alphabet or not using conditional operator.
7. Program to Check Whether a Character is Vowel or Consonant using Conditional operator
8. Program to Check Character is Alphabet, Digit or Special Character using Conditional operator
9. program to check whether a character is Uppercase or Lowercase using Conditional operator
10. Program to find smallest among three numbers using Conditional operator
11. Program to check whether the given integer is positive,negative or zero using Conditional operator
12. Program to print largest of two numbers using conditional operator
13. Program to print smallest of two numbers using conditional operator
14. Program to print largest of three numbers using conditional operator
15. Program to print smallest of three numbers using conditional operator
16. Program to print enter number is even number or odd number using conditional operator
17. Program to print check leap year or common year using Conditional operator
18. Program to check alphabet or no alphabet using conditional operator
19. Program to check alphabet or no alphabet using ASCII value and conditional operator
20. Program to check vowel or consonant using conditional operator
21. Program to check vowel or consonant using ASCII value and conditional operator
22. Program to check alphabet, digit or special symbal using conditional operator
23. Program to check alphabet, digit or special symbal using ASCII value and conditional operator
24. Program to check enter alphabet is upper case or lower case using conditional operator
25. Program to check enter alphabet is upper case or lower case using ASCII value and conditional operator
26. Program to check the given integer is positive,negative or zero using and conditional operator
27. Program to check enter week number and print day of week using conditional operator
28. Program to check print number of days in month using conditional operator
29. Program to check print number of days in month using or operator and conditional operator
30. Program to check print number of days in month and month name using conditional operator
31. Program to check print check triangle validity when angles are given using conditional operator.
32. Program to check valid triangle when sides are given using logical AND operator and conditional operator
33. Program to check isosceles,scalene or equilateral triangle when sides are given using conditional operator
34. Program to check calculate profit or loss using conditional operator
35. Program to enter student marks and find percentage and grade using conditional operator
36. Write a program to add 8 to the number 2345 and then divide it by 3. Now, the modulus of the quotient is taken with 5 and then multiply the resultant value by 5. Display the final result.
37. Write a program to check if the two numbers 24 and 45 are equal.
38. Write a program to print the power of 7 raised to 5.
39. The total number of students in a class are 90 out of which 45 are boys. If 50% of the total students secured grade 'A' out of which 20 are boys, then write a program to calculate the total number of girls getting grade 'A'.
40. Write a program to calculate the sum of the digits of a 3-digit number.
41. Write a program to reverse a 3-digit number
42. Check if the string "apple" is equal to the string "banana" using the equality operator. Print the result.
SOOPRO Pathshala Exercises
1. Write a program to get a number from the user and print whether it is positive or negative.
2. Write a program that takes three numbers from the user and prints the greatest number.
3. Write a program that takes a number from the user and generates an integer between 1 and 7. It displays the weekday name.
4. Write a program that reads two floating-point numbers and tests whether they are the same up to three decimal places.
5. Write a program to find the number of days in a month.
6. Write a program that takes a year from the user and prints whether it is a leap year or not.
7. Write a program to check even or odd number.
8. Write a program to print valid to vote if age greater than or equal to 18 else print not valid to vote.
9. Write a program to print maximum among two integer numbers.
10. Write a program to print square of maximum and cube of minimum number.
11. Write a program to print diff of max and min among three numbers.
12. Write a program to print grade of student marks.
13. Write a program to print both are equal no, if two numbers are equal else print not equal.
14. Write a program to print 1 if two integer numbers are same, else print 0.
15. Write a program to print smallest among three numbers.
16. Write a program to print addition of two numbers on choice 1, subtraction of two numbers on choice 2, multiplication of two numbers on choice3 and division of two numbers on choice 4.
17. Write a program to print area of circle on choice 1, area of rectangle on choice 2, area of traingle on choice 3, invalid choice on choice 4.
18. Write a program to print sum of square and cube of any even number.
19. Write a program to print diff of square and cube of any odd number.
20. Write a program to print product of square and cube of even number
SOOPRO Pathshala Exercises
1. Write a program to print 1 to 10 using for loop.
2. Write a program to print 10 to 1 using for loop.
3. Write a program to print 20 to 50 using for loop.
4. Write a program to print sum of 1 to 10 using for loop.
5. Write a program to print square of 1 to 10 using for loop.
6. Write a program to print cube of 1 to 10 using for loop.
7. Write a program to print even sum and odd sum of 1 to 10.
8. write a program to print table of any number using for loop.
9. Write a program to calculate the sum of first 10 natural number.
10. Write a program that prompts the user to input a positive integer. It should then print the multiplication table of that number.
11. Write a program to find the factorial value of any number entered through the keyboard.
12. Two numbers are entered through the keyboard. Write a program to find the value of one number raised to the power of another.
13. Write a program that prompts the user to input an integer and then outputs the number with the digits reversed. For example, if the input is 12345, the output should be 54321.
14. Write a program that reads a set of integers, and then prints the sum of the even and odd integers.
15. Write a program that prompts the user to input a positive integer. It should then output a message indicating whether the number is a prime number.
16. Write a program to calculate HCF of Two given number.
17. Write a do-while loop that asks the user to enter two numbers. The numbers should be added and the sum displayed. The loop should ask the user whether he or she wishes to perform the operation again. If so, the loop should repeat; otherwise it should terminate.
18. Write a program to enter the numbers till the user wants and at the end it should display the count of positive, negative and zeros entered.
19. Write a program to enter the numbers till the user wants and at the end the program should display the largest and smallest numbers entered.
20. Write a program to print out all Armstrong numbers between 1 and 500. If sum of cubes of each digit of the number is equal to the number itself, then the number is called an Armstrong number.
21. Write a program to print Fibonacci series of n terms where n is input by user :
22. Write a program to calculate the sum of following series where n is input by user. 1 + 1/2 + 1/3 + 1/4 + 1/5 +…………1/n
23. Write a program to print prime numbers between 2 to 50.
24. Write a program to print not prime numbers between 2 to 10.
25. Write a program to print your name ten times using while loop.
26. Write a program to print vowels and consonants of your first name.
27. Write a program to print vowels in left side and consonants in right side.
28. Write a program to print square of all odd numbers of 1 to 10.
29. Write a program to print cube of all even numbers of 1 to 10.
30. Write a program to print average of 1 to 10.
31. Write a program to print sum of table of any number.
32. Write a program to print sum of table of 1 to 5.
33. Write a program to print table of only even numbers between 5 to 20.
34. Write a program to print table of only odd numbers between 2 to 20.
35. Write a program to print total table sum between 1 to 10.
36. Write a program to print all even numbers between 2 to 50 in left side and all odd numbers in right side.
37. Write a program to print reverse of any three digit numbers.
38. Write a program to print sum of first and last number of any four digit numbers.
39. Write a program to print subtract of first and last number of any five digit numbers.
40. Write a program to print product of max and min of any four digit numbers.
41. Write a program to check whether given number is palindrome or not.
42. Write a program to check armstrong number.
43. Write a program to print table of max of and factorial of min of any five digit numbers.
44. Write a program to print sum of max and min and average of all three digit numbers.
45. Write a program to print following :
*
**
***
****
*****
46. Write a program to print table of any number in horizontal form.
47. Write a program to print square of all odd numbers in vertical form
48. Write a program to print factorial of 1 to 5.
49. Write a program to print factorial sum of all odd numbers between 1 to 10.
50. Write a program to print prime sum of odd even numbers between 5 to 50.
SOOPRO Pathshala Exercises
1. Create a single dimensional array.
2. Write a program to create single dimensional array and store values in it using user input.
3. Write a program to create single dimensional array of int type.
4. Write a program to create single dimensional array of char type.
5. Write a program to create float array of single dimensional array.
6. Write a program to create single dimensional array of double type.
7. Write a program to create single dimensional array of long type.
8. Write a program to create single dimensional array of string type.
9. Write a program to print sum of all elements of int array.
10. Write a program to print sum of all elements of long array.
11. Write a program to print sum of all elements of float array.
12. Write a program to print sum of all elements of float array.
13. Write a program to print even and odd of integer array.
14. Write a program to print square of integer array.
15. Write a program to print square of float array.
16. Write a program to print square of double array.
17. Write a program to print square of long array.
18. Write a program to print evensum and oddsum of int array.
19. Write a program to print square of even number and cube of odd number of array.
20. Write a program to print average of array.
21. Write a program to print sum and average of only even numbres in array.
22. Write a program to print multiplication of odd numbers of single dimensional array.
23. Write a program to print maximum of array.
24. Write a program to print sum and multiplication of odd numbers of single dimensional array.
25. Write a program to print minimum of array.
26. Write a program to print maximum and minimum of single dimensional array.
27. Write a program to print 2nd maximum number of array.
28. Write a program to print 2nd minimum number of array.
29. Write a program to print square of maximum of single dimensional array.
30. Write a program to print cube of minimum of single dimensional array.
31. Write a program to copy integer array.
32. Write a program to copy string array.
33. Write a program to copy float array.
34. Write a program to copy long array.
35. Write a program to print sum and average of only odd numbers of array.
36. Write a program to pass integer array to function.
37. Write a program to pass float array to function.
38. Write a program to pass long array to function.
39. Write a program to print sum of long array.
40. Write a program to return total sum of avg and sum of single dimensional array.
41. Write a program to return maximum of array.
42. Write a program to return minimum of array.
43. Write a program to return diff of maximum and minimum of array.
44. Write a program to return avg of even numbers of array.
45. Write a program to return sum of odd numbers of array.
46. Write a program to check prime and not prime of array.
47. Write a program to print primesum and not prime sum of array.
48. Write a program to return array.
49. Write a program to pass and return integer array.
50. Write a program to pass and return float array.
51. Write a program to pass and return double array.
52. Write a program to pass and return char array.
53. Write a program to pass and return long array.
54. Write a program to print reverse of string array.
55. Write a program to print sum of first value and last value of array.
56. Write a program to print factorial of array.
57. Write a program to print factorial of max and min of array.
58. Write a program to print factorial of diff of max and min of array.
59. Write a program to print table of array.
60. Write a program to print table sum of array.
61. Write a program to print table sum of array.
62. Write a program to create multi dimensional array.
63. Write a program to print first row of multi dimensional array.
64. Write a program to print second row of multi dimensional array.
65. Write a program to print third row of multi dimensional array.
66. Write a program to print table of first row of multi dimensional array.
67. Write a program to print table of last column of multi dimensional array.
68. Write a program to pass multi dimensional array to method.
69. write a program to pass and return matrix.
70. Write a program to pass string matrix and print second row of matrix.
71. Write a program to pass char matrix and print second column of matrix.
72. Write a program to pass float matrix and return avg of third row of matrix.
73. Write a program to print array elements in ascending order
74. Write a program to print array elements in descending order.
75. Write a program to print square of second maximum and cube of third minimum of single d array.
SOOPRO Pathshala Exercises
1. Write a program to show the simple structure of a function.
2. Write a program to find the square of any number using the function.
3. Write a program to swap two numbers using a function.
4. Write a program to check if a given number is even or odd using the function.
5. Write a program to check whether a number is a prime number or not using the function.
6. Write a program to get the largest element of an array using the function.
7. Write a program to check Armstrong and Perfect numbers using the function.
8. Write a program to print table of any number using function.
9. Write a program to print sum of any table using function.
10. Write a program to compare string value using function.
11. Write a program to find the maximum and minimum of some values using a function that returns an array.
12. Write a program to print the square of array elements using callback function.
13. Write a program to find cube of any number using function.
14. Write a program to find diameter, circumference and area of circle using functions
15. Write a program to find maximum and minimum between two numbers using functions.
16. Write a program to check whether a number is even or odd using functions.
17. Write a program to check whether a number is prime, Armstrong or perfect number using functions.
18. Write a program to find all prime numbers between given interval using functions.
19. Write a program to print all strong numbers between given interval using functions.
20. Write a program to print all Armstrong numbers between given interval using functions.
21. Write a program to print all perfect numbers between given interval using functions.
22. Write a program to find power of any number using recursion.
23. Write a program to print all natural numbers between 1 to n using recursion.
24. Write a program to print all even or odd numbers in given range using recursion.
25. Write a program to find sum of all natural numbers between 1 to n using recursion.
26. Write a program to find sum of all even or odd numbers in given range using recursion.
27. Write a program to find reverse of any number using recursion.
28. Write a program to check whether a number is palindrome or not using recursion.
29. Write a program to find sum of digits of a given number using recursion.
30. Write a program to find factorial of any number using recursion.
31. Write a program to generate nth Fibonacci term using recursion.
32. Write a program to find GCD (HCF) of two numbers using recursion.
33. Write a program to find LCM of two numbers using recursion.
34. Write a program to display all array elements using recursion.
35. Write a program to find sum of elements of array using recursion.
SOOPRO Pathshala Exercises
1. Write a c program to create void pointer.
2. Write a c program to create null pointer.
3. Write a c program to create wild pointer.
4. Write a c program to create pointer to pointer.
5. Write a c program to create dangling pointer.
SOOPRO Pathshala Exercises
1. Write a c program to copy one string to another string.
2. Write a c program to compare two strings.
3. Write a c program to find length of your first name.
4. Write a c program to reverse your first name.
5. Write a c program to convert your first name in uppercase.
6. Write a c program to convert your first name in lowercase.
7. Write a c program to concatenate and print first name and last name.
SOOPRO Pathshala Exercises
1. Write a c program to print factorial of any number using recursion technique.
2. Write a c program to print 1 to 10 using recursion technique.
SOOPRO Pathshala Exercises
1. Write a c program to create simple structure having book title,author,bookid and price.
2. Write a c program to pass structure to function
3. Write a c program to create structure inside another structure.
4. Write a c program to pass structure to pointer.
5. Write a c program to create global structure.
SOOPRO Pathshala Exercises
1. write a c program to create union
SOOPRO Pathshala Exercises
1. Write a c program to allocate dynamic memory using malloc() function
2. Write a c program to reallocate dynamic memory using realloc() function
SOOPRO Pathshala Exercises
1. Write a c program to create text file.
2. Write a c program to create word file.
4. Write a c program to write text to word file.
5. Write a c program to read from file using fscanf() function.