C Pragramming Theory and Lab Questions Updated
C Pragramming Theory and Lab Questions Updated
Certifications to Complete:
Sno Task to Finish Due Date
1 Finish “Computer Basics” and upload the certificate 2 days from
on LinkedIn Joining Date
2 Finish “Programming Basics, Logics & Techniques” 6 days from
Course and upload the certificate on LinkedIn Joining Date
3 Finish Beginner Level Course on C Language @ Code 15 days from
Chef and Upload Certificate on LinkedIn joining date
4 Finish “C Programming Language” and upload on 30 days from
LinkedIn joining date
Assignments to Complete:
Sno Task to Finish Due Date
1 60 Theory Questions Every week 15 questions
2 200 Programs Submission Every week 50 Programs
2. Write a Program to Read Price of iPhone & Cover Case and calculate total Bill.
3. Write a program that reads the bill amount and the amount paid by the customer, and
then display the balance amount to be returned to the customer?
Expected Output:
Input:
Enter the Total Bill Amount: 1895
Enter the amount paid by the customer: 2000
Output:
Balance amount to be returned is: Rs. 105/-
4. Write a Program to read Marks of 5 Subjects English, Sanskrit, Math’s, Physics &
Chemistry, Calculate Total & Average.
5. Write a Program to Read Basics Salary of an Employee and Display Gross Salary and Net
Salary from the following information.
HRA is 20% of Basic Salary
DA is 10% of Basic Salary
PF is 5% of Basic Salary
Note:
Gross Salary = Basic Salary + HRA + DA
Net Salary = Gross Salary – PF
6. Write a Program to swap values of two Variables A and B without using 3 rd variable
7. Write a Program to Read Total Flying time from Hyderabad to Singapore in minutes and
display into hours and minutes.
Input:
Enter Flying time from Hyderabad to Singapore in minutes: 135
Output:
Flying time from Hyderabad to Singapore is 2 hrs and 15 minutes.
Expected Output:
Input:
Enter No of Days:500
Output:
Years:1
Months:4
Weeks:2
Days:1
9. Write a Program to read 3 characters from the and display them in Reverse Order.
Expected Output:
Input: Enter 3 characters of your choice: A B C
Output: Reverse of ABC is CBA
10. Write a Program to Read Full name, Gender and Native Place of a Person and Display.
Input:
Enter ur Full Name: Raj Jain
Enter ur Gender(M/F): M
Enter ur Native Place: Rajasthan
Output:
Raj Jain - M - Rajasthan
11. Write a Program to Read Roll no, Name, Gender & Height of a person display how many
bytes of memory each variable occupies.
Note: height should be double type
Input:
Enter Roll no: 101
Enter Gender(M/F): M
Enter Name: Raj Jain
Enter Height: 5.7
Output:
Roll no Occupies 4 bytes of space
Gender Occupies 1 byte of space
Name occupies 20 bytes of space
Height occupies 8 bytes of space
Input:
Enter any Upper-case Alphabet from A to Z: D
Output:
Lower case form of D is d
13. Write a Program to read the temperature in Fahrenheit and Convert into Centigrade.
17. Mr. Rao is an Employee, write a C Program to Calculate Gross Salary and Net Salary from
the input Basic Salary, Allowances and Deductions.
18. Write a Program to Calculate Electricity from the Inputted Present Month and Last
Month Reading.
Note: Rate Per unit is: 7.85/-
19. Write a Program to Display the following in the Center of the Screen.
AH CAREER PVT LTD
Danavaipeth
Rajahmundry.
20. A Bus Travels from Point A to Point B Every day, write a Program to read Total Travelling
in Kilo Meters and Display into meters.
21. Group of Friends Went to a Restaurant, you must help those friends to Split the Total Bill
along with the TIP among them.
Note: TIP is %5 or 10% of Bill Amount.
Input:
Enter Total Bill Amount: 2500
Enter the TIP (5% or 10%): 10
Enter Total Number of Friends: 5
Output:
Each One Have to Pay Rs. 555.00 /-
Test case 1:
Input:
Enter ur Age: 21
Expected Output:
Congratulations! "You are eligible" for casting your vote.
Test case 2:
Input:
Enter ur Age: 11
Expected Output:
Opps! You are "Too Young" to Vote.
2. Write a Program to read price of Samsung Mobile & Vivo Mobile and display which is
Costlier, if both the mobiles are at same price then display “Both are at Same Price."
3. WAP to calculate the discount and final amount based on given data: -
Note: If sales>= 25000 then 10% is allowed other wise 5% discount is allowed.
4. Write a program that prompts the user to enter the names and ages of two friends, and
displays which friend is older or if they are the same age."
8. Write a program to read the price of 3 pens Reynolds, Montex and Parker and display
which is the costliest one.
9. Create a program that takes three numbers as input and displays them in ascending
order. Use if and else statements to compare the numbers and arrange them accordingly.
11. Write a C program to read cost price and selling from the user and calculate profit or
loss or no loss no profit.
Test Case 1:
Input:
Enter Cost Price: 100
Enter Selling Price: 150
Output:
Heyy, You have made a profit of Rs.50/-
Test Case 2:
Input:
Enter Cost Price: 200
Enter Selling Price: 180
Output:
Oops!, You Incurred a Loss of Rs.20/-
Test Case 3:
Input:
Enter Cost Price: 250
Enter Selling Price: 250
Output:
Hmmm!, No Loss…No Profit…
12. Write a program to read rating of 3 movies of ur choice and display which is the hit
movie(use logical operator && ). (Note: Rating is 1 to 10 )
Input:
Input Temperature in centigrade:
42
Expected Output:
Its very hot.
14. AHC Constructions Constructed a High Rise Building which has 50 floors, Families who
are residing at even Floors has beach view and Families who are residing at odd floors has
Forest View, write a C Program to read the Floor number and display which view the floor
has.
Note: Floor number should be <=50, otherwise displays a message “We have only 50 floors”
Test Case 1:
Input:
Enter ur Floor number: 12
Output:
Heyy you have "Beach View" for your Flat.
Test Case 2:
Input:
Enter ur Floor number: 21
Output:
Heyy you have "Forest View" for your Flat.
Test Case 3:
Input:
Enter ur Floor number: 81
Output:
We have only "50 floors"
15. Write a Program to read a character and check whether it is capital letter or lower-case
letter or Digit or Special character.
17. Write a Program to read your year of birth and check whether you were born on leap
year or not.
18. Write a program in C to calculate and print the electricity bill of a given customer. The
customer ID, name, and unit consumed by the user should be captured from the keyboard
to display the total amount to be paid to the customer.
Input:
Input Customer Id: 1001
Input Customer Name: James
Input Units Consumed: 800
Expected Output:
Customer IDNO: 1001
Customer Name: James
Unit Consumed: 800
20. WAP to print the discount and the actual amount from the given details.
Sales Discount
>=25000 25%
20000 – 25000 20%
10000 – 20000 10%
5000 – 10000 5%
Below 5000 no discount
22. WAP to check whether the inputted data is capital letter or small letter or
digit or special character.
24. WAP to check whether the person is eligible for bonus or not based upon the
data given below. Bonus is given only to the following persons.
i. Persons who are married.
ii. Unmarried Male above 30 years.
iii. Unmarried Female above 25 years.
26. South central railway gives 50% concession to its passengers those who fulfill
the following eligibility criteria.
i. Male above 60 years of age
ii. Female above 50 years of age
iii. Full concession for under 5 years (no ticket is required).
WAP to check if a passenger is eligible for concession based on the above data.
28. WAP to accept marks of c, cpp, java and calculate total, average, class only if
the student passes in all the 3 subjects otherwise display the subject in which
he is failed and message as “no grade”.
30. Write a program to check whether inputed no is even or odd using ternary
operator. (use only % operator).
31. Write a C program to accept the height of a person in centimeter and categorize
the person based on height as taller (above 5.5), dwarf(low height)(below 4.5) and
average height person based in feet.
(Note: 1 feet = 30.48 cm)
Enter a no..: 10
Enter another no..: 20
Enter ur option(+,-,*,/,E)..: +
Output : 10 + 20 = 30
34. Write a C Program to accept a grade and declare the equivalent description if code
is S, then print SUPER, if code is A, then print VERY GOOD, if code is B, then print
FAIR, if code is Y, then print ABSENT, if code is F, then print FAILS. (use switch case)
35. Write a C program to find out whether the character presses through the
keyboard is a digit or not (using conditional operator).
36. Write a program which reads two integer values. If the first is lesser print the
message "up". If the second is lesser, print the message "down" if they are equal,
print the message "equal".
37. Write a C program that prints the given three integers in ascending/descending
order using if – else.
38. Given as input three integers representing a date as day, month, year, print the
number day, month, and year for the next day's date.
Typical input: “28 2 1992”
Typical output: “Date following 28:02:1992 is 29:02:1992”.
39. Write a program to display the traffic control signal lights based on the
following. (switch-case)
✓ If user entered character is R or r then print “RED Light Please STOP”.
✓ If user entered character is Y or y then print “YELLOW Light Please Check and
Go”.
✓ If user entered character is G or g then print “GREEN Light Please GO.”
✓ If user entered some other character, then print “THERE IS NO SIGNAL POINT.”
40. Write a program in C to accept a grade and declare the equivalent description:
(Using switch-case)
Grade Description
E Excellent
V Very Good
G Good
A Average
F Fail
Sample input 1:
Enter ur name: Raj Jain
Enter ur 12 Digit Aadhar No: 1234123412341234
Output:
Heyy Raj Your Aadhar No 1234123412341234 is Verified successfully.
Sample input 2:
Enter ur name: Ramesh Kumar
Enter ur 12 Digit Aadhar No: 123412341234123
Output:
Heyy Ramesh Kumar Your Aadhar No 123412341234123 is invalid, kindly
recheck.
8. Write a Program to check whether the inputted number is Perfect number
of not.
14. Write Program to print prime numbers between two given Positive
numbers.
▪ If the first number is greater than the second number, then display a
message “Invalid Range” and stop the Program.
15.Write a Program to Print all the Arm Strong Numbers between 100 and
1000.
18.Write a Program to keep on reading numbers from the user till the user
inputs 0, and count numbers of even numbers and odd numbers along with
sum.
1. Write a Program to Read Array of N Elements and Print Total & Average.
2. Write a Program to fill the Array of 10 Elements with Even Numbers at odd
index and Odd Numbers at even Index.
▪ First Even Number is 2 and First Odd Number is 1
3. Write a Program to Fill the Array of 10 Numbers with Random Numbers,
Print Even Numbers, Odd Number and Prime Numbers Separately.
▪ Random Numbers Must Not Exceed 999/-
4. Write a Program to Fill the Arrays of 10 Elements with Random Numbers
and sort them in Ascending Order and Descending order and print
Separately.
5. Write a Program to fill the Array of N Elements of Multiples of 5 and copy
to another array and print.
6. Write a Program to Build Tambola (Housie) App.
▪ To build this application you must fill an array with 90 unique
numbers.
7. Write a Program Find Minimum and Maximum Number from the Array of
10 Inputted Numbers.
8. Write a Program to Find Frequency of Each element from the Array of N
Elements.
9. Write a Program to Fill Array of 10 Random Numbers and Count Number of
digits of Each Element of the Array.
10.Write a Program to Insert an Element in the Array of N Elements
11.Write a Program to Delete a from the Array of N Elements
12.Write a Program to Perform Matrix Multiplication of Two Arrays of 3*3 Size.
13.Write a Program to Print Diagonal Elements of a Square Matrix (5*5).
14.Write a Program to Print Upper Triangle and Lower Triangle of 5*5 Array.
15.Write a Program to Search for an Element in 5*5 Matrix.
1. Create a Header with the name “myfunctions.h” and create 4 functions in it.
1. Function to calculate mean of 3 nos
2. Function to check Positivity or Negativity of a number.
3. Function to find word count of a string
4. Function to convert the string into proper case
3. Write a Program to read Student name and any of the Identity Proof
from the following.
a. Aadhar no
b. Passport No
c. PAN No
d. Driving License No
Create a Functions to read the student name and id proof, display all the
student names with id proofs and search function to display Student
name using aadhar no.