0% found this document useful (0 votes)
121 views4 pages

C Programming Lab Exam Tasks

Uploaded by

moneyassets505
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
121 views4 pages

C Programming Lab Exam Tasks

Uploaded by

moneyassets505
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

SRM University – AP, Andhra Pradesh

Neerukonda, Mangalagiri Mandal


Guntur District, Mangalagiri, Andhra Pradesh – 522240
Department of Computer Science and Engineering
Lab Internal Exam
Program/Degree : B.Tech (Regular) Academic Year : 2024 – 25
Course Name : C programming-Lab Course Code : CSE101
Sem. / Sec. : 1 / H,I,J,K&M Sections Joined Batch : 2024 Batch
L-T-P-C : 3-0-1-4 Max. Marks : 50

1. Sarah is intrigued by a number reversal code she found. The code takes a positive integer n as input
and then performs a series of operations. Help Sarah write a program that reverses the number.

2. Sophie is a curious student who is fascinated by the concept of factorials. She wants to create a
program that can calculate the factorial of any given number. Help Sophie write a program that takes
a number from the user and calculates its factorial.

3. The program takes a positive integer as input, representing the desired number of rows for the
pattern, and prints the required pattern as shown in the below example using a do-while loop.

4. Olivia is an individual interested in understanding income tax calculations. Create a program to


assist Olivia in calculating income tax based on her income.

Prompt Olivia to input her income and utilize the ternary operator to calculate and display the
corresponding tax amount, rounded to two decimal places, following these rules:
1. No tax (0%) if income ≤ 2,50,000
2. 5% of income, if income ≤ 5,00,000 (inclusive)
3. 10% of income, if income ≤ 10,00,000 (inclusive)
4. 20% of income, for income > 10,00,000
5. In a digital game, players input a number to unlock levels. Develop a program using logical operators that
takes an integer as input and checks whether it satisfies the specified conditions to unlock the next level.

1. The number must be greater than or equal to 10.

2. The number must be less than or equal to 100.

3. The number must not be divisible by 7.

Implement a program to notify players of their eligibility to unlock the next game level.

6.Merlin is working on a calendar application that requires a leap-year verification feature for accurate event
scheduling. Users input a year, and her program determines whether it's a leap year or not, aiding in precise
calendar calculations. Help her write a program to determine if the given year is a leap year or not.

7. Selva is developing a temperature conversion tool for a weather application that allows users to convert
temperatures between Celsius and Fahrenheit based on their preference.

The program will prompt the user to enter a temperature value and then choose the desired conversion:

1. C or c - Fahrenheit to Celsius

2. F or f - Celsius to Fahrenheit

Help Selva to write a program that performs the accurate conversion and displays the result.

8.Imagine you are tasked with creating a program to assist in sorting numbers. The program should take
three numbers as input and then arrange them in ascending order.

Implement the program to ensure that the entered numbers are correctly organized in ascending order.

9. Create a program that generates and prints the Fibonacci series up to a specified number 'N'. The
Fibonacci series is a sequence of numbers in which each number is the sum of the two preceding numbers,
starting with 0 and 1.

Your program should take an integer input 'N' and display the Fibonacci series up to the N th term.

Fibonacci series: 0, 1, 1, 2, 3, 5, 8,...

10. John wants to create a program that can print the multiplication table of any given number. He believes
that this program will help him practice and understand multiplication better.

Help John write a program that takes a number from the user and prints its multiplication table using a do-
while loop. It should then print the table from 1 to 10 for that particular number.

11. Write a C program to Check the give number is Armstrong number or not
12. You are organizing a mathematics competition where participants need to test their knowledge of prime
numbers. As part of the competition, you decide to write a program that checks whether a given number is
prime or not. During the competition, each participant will enter a number, and your program will determine
if it is prime.

13. Emma is intrigued by a program designed to calculate the sum of numbers provided by a user. The
program repeatedly prompts the user to input a number. The entered number is then added to a running
total.if he enters -1 then terminate the program.

14. Janice is developing a program to validate mobile phone numbers. Her program aims to verify whether a
given mobile number is valid or not.

The validation criteria are as follows:

1. The number must consist of 10 digits.

2. It must start with either 7, 8, or 9.

15. Write a program to store n elements in array a[10] and get a number to search in the array. Your program
should display whether the search number is present in the array or not.

16. Sita has a collection of cards represented as an array. She wishes to add a new card to her collection,
specifically placing it in the second position within this array. Develop a program that will enable Sita to
insert the new card at the second position (The value of the position starts from 1).

17. Arve is learning about matrices and wants to write a program to find the sum of diagonal
elements(Principal diagonal) in a matrix using a 2D array. The program takes an input matrix, calculates the
sum of its diagonal elements(Principal diagonal), and then displays the computed sum.

18.Write a C program to print the multiplication of two matrices.

19.Write a C program to take the input of 5 subject’s marks and print the total,average and assign the grades
as follows

If 100>=m>=90 → A grade

If 90>m>=80 → B grade

If 80>m>=70 → C grade

If 70>m>=60 → D grade

If m<60 → Fail

20.Write a program to get the minimum and maximum element of the given array of the elements.

You might also like