Assignment-C Progs
Assignment-C Progs
C- Programming
1) Write a program to compute the Square (a*a) and the Cube (a*a*a) for first 10 numbers.
2) Using if-else statement, write a programme where user gets an option to calculate his salary
based on his/her attendance. (E.g. Salary amount has to be user input. Employee gets full
salary with bonus if the attendance is full, for each absentee, Rs 100 is deducted from the
base salary.)
3) Write a program to state if the number entered is odd or even. (Hint: Even numbers are
completely divisible by 2, odd aren’t)
4) Out of 10 students some students are to be admitted to a particular course if the fulfil the
following conditions:
Write a program to print the percentage, height and whether or not the student is selected.
5) Write a program to calculate the area of a Triangle, Square, Rectangle and Circle.
The user can choose which shape’s area he/she wants to compute.
6) Write a program to state whether the entered year is a leap year or not.
7) Write a program to calculate the average and marks of a student and give an appropriate grade for the
same.
9) Write a program to calculate the sum of numbers from 1 to 10 using for, while and
do-while loops. Draw flow charts for the same.
10) A university has the following rules for a student to qualify for a degree with A as
the main subject and B as the subsidiary subject:
Write a program to receive marks in A and B and output whether the student has passed, failed or
is allowed to reappear in B.
11) Write a program to find the greatest of the three numbers entered through the keyboard using
conditional operators. Draw a flow chart for the same.
12) A library charges a fine for every book returned late. For first 5 days the fine is 50 paise, for 6-10 days fine is one rupee
and above 10 days fine is 5 rupees. If you return the book after 30 days your membership will be cancelled. Write a
program to accept the number of days the member is late to return the book and display the fine or the appropriate
message.
13) If the three sides of a triangle are entered through the keyboard, write a program to check whether the triangle is valid or not. The
triangle is valid if the sum of two sides is greater than the largest of the three sides.