0% found this document useful (0 votes)
7 views

C Program

c program

Uploaded by

amos
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

C Program

c program

Uploaded by

amos
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

UNITY COLLEGE OF PROFESSIONAL STUDIES

C EXAM

1. Write a C program to sum all the items in an array


2. Write a C program that calculates the area of a circle based on the radius entered by the user.
3. Explain the difference between a tuple and a list in C and write a code to show the difference
4. Define a set in C and write a program in C to create a set
5. Explain the difference between a for loop, while loop and do while loop and write a program to
demonstrate each.
6. Write a C program that will the allow the user to enter the name of a student, marks of five
different subjects, find the total of the subjects, calculate the average and find the grade of the
student using the following criteria;

AVERAGE GRADE
80 -100 A
70-79 B
60-69 C
50-59 D
0-49 E

7. A user wants to calculate the area and perimeter of a right angled triangle using a C program.
The user is required to enter the base and height of the rectangle. The hypotenuse of the
rectangle should be calculated after entering the value of the base and height. Find the area and
perimeter of the rectangle.
8. Write a C program to create an array of 5 integers and display the array items. Access individual
elements through indexes.
9. Write a C program to add an item to an array
10. Define a data type and give the different examples of data types and a code to show how to
declare different variables using different data types
11. Write a C program that will allow the user to input the following data name of student,
admission number, age and DOB.
12. Write a C program that will print even number between 0 to 1000 using a loop.

You might also like