Basic code in c.

                             

  • If the marks obtained by student in five different subjects are input through the keyboard, write a program to find out the aggregate marks and percentage marks obtained by the student. Assume that the maximum marks that can be obtained by a student in each subject is 100.
  •  Temperature of a city in Fahrenheit degrees is input through the keyboard. Write a program to convert this temperature into Centigrade degrees.
  • The length and breadth of a rectangle and radius of a circle are input through the keyboard. Write a program to calculate the area and perimeter of the rectangle, and the area and circumference of the circle.
  • paper of size A0 has dimensions 1189 mm x 841 mm. Each subsequent size A(n) is defined as A(n-1) cut in half parallel to its shorter sides. Thus paper of size A1 would have dimensions 841mm x 594 mm. Write a program to calculate and print paper sizes A0, A1, A2......... A8.
  • Write a program to determine and print the sum of the following harmonic series for a given value of n:                                                                                                                                                                        1+1/2+1/3+.....+1/n                                                                                                           The value of n should be given interactively through the terminal.
  •  Write a program to read the price of an item in decimal form (like 15.95) and print the output in paisa (like 1595 paise).
  • Write a program that prints the even number from 1 to 100. 
  • Write a program that requests two float type number from the user and then divides the first number by the second and display the result along with the numbers. 
  • The price of one kg of rice is Rs. 16.75 and one kg of sugar is Rs. 15. Write a program to get these values from the user and display the prices as follows:                                                          ***LIST OF ITEMS***                                                                                                                    Item             Price                                                                                                                                Rice             Rs. 16.75                                                                                                                          Sugar           Rs. 15.00 
  • Write program to count and print the number of negative and positive numbers in a given set of numbers. Test your program with a suitable set of numbers. User scanf to read the numbers Reading should be terminated when the value 0 is encountered.
  • Write a program to do the following:
    • Declare x and y as integer variables and z as a short integer variable.
    • Assign two 6 digit numbers to x and y
    • Assign the sum of x and y to z
    • Output the values of x, y and z Comment on the output. 
  • Write a program to read two floating point numbers using a scanf statement, assign their sum to an integer variable and then output the values of all the three variables.                                                          
  • Write a program to illustrate the use of typedef declaration in a program.
  • Write a program to illustrate the use symbolic constants in a real-life application.
  • If lengths of three sides of a triangle are input through the keyboard, write a program to find the area of the triangle.
  • If a five-digit number is input through the keyboard, write a program to reverse the number. 
  • Consider a currency system in which there are notes of seven denominations, namely, Rs. 1, Rs. 2, Rs. 5, Rs. 10, Rs. 50, Rs. 100. If a sum of Rs. N is entered through the keyboard, write a program to computer the smallest of notes that will combine to give Rs. N.
  • If a five-digit number is input through the keyboard, write a program to calculate the sum of its digits. (Hint: Use the modulus operator '%')
  • Write a program to receive Cartesian co-ordinates (x, y) of a point and convert them into polar co-ordinates (r,  ).                                                                                                                  Hint: r=sqrt ( x)
  • Write a program to receive values of latitude (L1, L2) and longitude (G1, G2) in degrees, of two places on the earth and output the distance (D) between them in nautical miles. The formula for distance in nautical miles is: