The document outlines an assignment focused on basic C programming tasks. It includes instructions for checking syntax and provides ten specific programming exercises related to salary calculation, area and perimeter of geometric shapes, and student marks aggregation. Each task requires user input and outputs the results on the screen.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
2 views
Assignment 5
The document outlines an assignment focused on basic C programming tasks. It includes instructions for checking syntax and provides ten specific programming exercises related to salary calculation, area and perimeter of geometric shapes, and student marks aggregation. Each task requires user input and outputs the results on the screen.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2
ASSIGNMENT -5 (BASICS OF C PROGRAMMING)
Basic instructions: 1. Check every line of your program for semicolon (;) 2. Check printf for format specifier %d for integer numbers 3. Check scanf for %d and & sign before variable name
1. Aman’s basic salary is input through the keyboard. His
dearness allowance is 50% of basic salary, and house rent allowance is 20% of basic salary. Write a program to calculate his gross (total) salary. Print the salary on screen. 2. The length and breadth of a rectangle is input through the keyboard. Write a program to calculate the area of a rectangle. Print the area on output screen. 3. The length and breadth of a rectangle is input through the keyboard. Write a program to calculate the perimeter of a rectangle. Print the result on output screen. 4. The side of a square is input through the keyboard. Write a program to calculate the area of a square. Print the area on output screen. 5. The side of a square is input through the keyboard. Write a program to calculate the perimeter of a square. Print the result on output screen. 6. The radius of a circle is input through the keyboard. Write a program to calculate the area of a circle. Print the area on output screen. 7. The radius of a circle is input through the keyboard. Write a program to calculate the circumference of a circle. Print the result on output screen. 8. Enter the three sides of a triangle. Find the sum of three sides of the triangle. Print the result on the screen. 9. If the marks obtained by a student in five different subjects are input through the keyboard, write a program to find out the aggregate marks. Print the aggregate marks of the student on screen. 10. Assume that the maximum marks that can be obtained by a student in any subject is 100. If the marks obtained by a student in five different subjects are input through the keyboard, write a program to find out the percentage obtained by the student. Print the percentage of the student on screen