Practical-C QN Edit
Practical-C QN Edit
21.a. You are working on an online quiz application, and you want to include a
feature where a user is asked to input a number, and the application checks if the
number is prime or not. This helps the user learn about prime numbers as part of
the educational content. The system needs to determine if the number provided by
the user is prime. A prime number is one that is greater than 1 and has no divisors
other than 1 and itself.
b. You're playing UNO cards, suddenly a person is getting a rev card. Write a C
program to reverse the round by storing the number of players in the array.
22.a. You are building a mathematical learning tool for students that demonstrates
how to generate sequences in mathematics. One of the features is showing the
Fibonacci sequence, where each number is the sum of the two preceding ones. The
student can input a number N, and the tool will display all Fibonacci numbers up to
N. The system will generate the Fibonacci sequence up to a user-defined N to help
visualize the growth of the sequence.
b. Write a C program for Vehicle Regulation System where odd number ending
vehicles can use the road on odd days and even number ending vehicles can use the
road on even days using two separate arrays to store and display the odd and even
numbers.
You are developing a simple library management system for a local library. The
library has a small collection of 5 books, and they want to create a feature where
users can quickly check if a specific book is available. This feature is particularly
useful for library staff or library visitors who want to see if a book is in stock
without having to browse physically through the shelves.A user (or library staff)
will input the title of a book they are looking for, and the system will check if that
book is available in the library's predefined list of books. If the book is available,
the system will inform the user, and if it's not, the system will notify the user that
the book is not available.
You are building a student management system for a school that calculates the
average grade of a group of students and determines whether each student passes
or fails based on a given threshold (e.g., passing grade is 50%).A teacher enters the
grades of N students, and the system calculates the average grade for the class.
Based on the average grade, it also determines if each student has passed or
failed.If a student's grade is above the threshold (e.g., 50%), the system marks
them as “Pass,” otherwise “Fail.”
b. Write a C program to do the following applications in array to Search the
number '5' in array and replace it with '10'
36.a. Write a program to receive values of latitude (L1, L2) and longitude (G1,
G2), in degrees, of two places on the earth and output the distance (D) between
them in nautical miles. The formula for distance in nautical miles is:
D = 3963 cos-1( sin L1 sin L2 + cos L1 cos L2 * cos ( G2 – G1 ) )
b. Write a C program that generates a random number between 1 and 100 and asks
the user to guess it. Use a do-while loop to give the user multiple chances until
they guess the correct number.
37.a.Paul has bought three tires for his vehicle. Now he wants to find the smallest
one. Help him to calculate the area and circumference of a circle in terms of a flow
chart and a C program with sample input and output.
(Note: Area=πr2 Circumference= 2πr)
b. Write a C program that prompts the user to enter a password. Use a do-while
loop to keep asking for the password until the correct one is entered.
38. a.Gauss was given a numerical problem to solve as an assignment. The input
given is an integer number. He has to find the sum of the values from 1 to n.
Devise an algorithm and Flowchart to help him.
b. Write a C program that calculates the compound interest for a given principal
amount, interest rate, and time period. Use a do-while loop to allow the user to
input values multiple times.(Note: ((P*(1+i)^n) - P))
39.a. Rathik organized technical round interview in Msoft for the set of computer
science candidates. The problem is to perform addition, subtraction, multiplication,
and find the quotient and remainder of division of given two numbers. Rathik have
given the deadline of only 2 minutes to complete the problem.Can you Help the
candidates to complete the problem within the specified time limit using a C
Program and Flow Chart?
b. Write a C program that calculates the average of a set of numbers input by the
user. The user should be able to input as many numbers as desired, and the
program should continue until the user decides to stop.
40.a. Milina brought a water bottle and found its shape to be a cylinder. However,
she is sure of the quantity of water the bottle can hold. She somehow measured the
diameter and the height of the bottle. Help her to determine the capacity of the
bottle using a C Program and Flowchart. (Note: Volume: pi*r 2h)
b. Write a program in C to display the cube of the number up to an integer.
41.a. During the Test match between India and Srilanka, as a part of Asia Cup
tournament, a question was asked to the fans. Fans giving the correct answer will
get the free VIP box ticket to the inaugural match of upcoming ICC Men’s World
Cup. Help the fans to answer the question and to win free ticket by giving them the
solution in terms of flow chart and Program. Question: Who has got the more ODI
runs? [Biggest among three]
Sachin Tendulkar B. Brian Lara C. Ricky Ponting [Note: Run Scored by Sachin
Tendulkar – 18426, Brian Lara – 10405, Ricky Ponting– 13704]
b. Write a program in C to display the multiplier table vertically from 1 to n.
42.a. The management of a reputed engineering college has released the eligible
students list for the upcoming academic year. But Arpitha could not find her name
in the list. So, she gets confused about her eligibility for the admission. Can you
clarify her doubt by giving her the right solution using a flowchart and a program
using Functions? [Hint: Cut off mark above 190 is eligible. cutoff mark can be
calculated as follows (Physics mark/2 + Chemistry mark/2 +Mathematics mark).
b. Write a program in C to display the square of the number up to an integer.
43.a. A shop gives 30% discount to its customers if their birthday falls on a leap
year. So , Geeta wants to avail this offer help her to check whether her birth year is
leap year or not’.
b. Write a program in C to make such a pattern like a right angle triangle with a
number which will repeat a number in a row.
44.a. Lucky draw game is conducted in an exhibition , the winner is selected based
on the given criteria. Totally three numbers are placed , the person who gets the
highest number will be announced as the winner.
b. Write a C program to make such a pattern like a pyramid with a number which
will repeat the number in the same row.
45.a. A technical event is conducted in a college the incharge asked the participants
to find the ASCII value for their name, help them with a program to achieve it.
b. Write a C program that prompts the user to input a series of integers until the
user stops entering 0 using a while loop. Calculate and print the sum of all the
positive integers entered.
46.a. Geetha is given a task of writing her name in reverse order and then merge it
with her name . Help her to complete the task by using c program.
b. Write a C program that prompts the user to input a username. Use a while loop
to keep asking for a username until a valid one is entered (e.g., at least 8 characters
long).
47.a. King Indravarma ordered his servants to distribute gifts for the people. They
arranged for the gifts and kept them in a room. Dolu and Bolu is excited about
gifts. Kalia is up to his mischievous self again. He tied balloons to all the gifts that
the king had kept for distributing to the people. The balloons are tied in height of
50m to 90m above the ground. He challenged Bheem to shoot down the balloons
and collect all the gifts by blind folding his eyes. Write a program to help Bheem
to shoot down the balloons.
b. Write a Program to check if the given number is Even or Odd.
48.a. In Kolkata, every year during dhasara there will be a grand doll show. People
try to create new dolls of different varieties. The best sold doll's creator will be
awarded with a cash prize. So people break their head to create dolls innovatively.
Knowing this competition, Mr.Raju tried to create a doll which sings only when an
even number is pressed and the number should not be zero and greater than 100.
So write a C program to help Mr.Raju to win.
b. Write a C program that accepts two item's weight and number of purchases
(floating point values) and calculates their average value.
49. a.Mr. Vetri is a very rich businessman and he lost his family in the Gujarat
Earthquake. He lost interest in his business after the tragic incident and he decided
to serve the society. He started an NGO named after his only son Ishan to help the
earth-quake victims. Ishan Helpline will provide compensation to all earth quake
survivors. The compensation amount given to the survivors is not fixed and it
depends on the intensity of the earthquake. The expression Richter magnitude scale
refers to a number of ways to assign a single number to quantify the energy
contained in an earthquake.
Magnitude Type
2.4 or less Micro
2.5 to 5.4 Light
.5 to 6.0 Moderate
6.1 to 6.9 Strong
7.0 to 7.9 Major
8.0 or greater Great
Please help Ram to decide the intensity of the earthquake.
b. Write a Program to make a simple calculator.
50. a.A teacher tries to relate between the Angles inscribed in a circle and the
direction. Initially she wants to teach them the directions related with the angle’s
0,90,180,270 indicating East, North, West, South respectively. Write a C program
using selection statement to denote the direction graphically corresponding to the
angle entered.
b. Write a C program that prints “yes” if the given integer is divisible by 2 or 3 and
“no” otherwise.
51.a. Rangan is very weak in converting the numbers into months. But his friends
often tease him by asking him to convert a number into a month. To solve his
problem a close friend of him, suggested him to meet SIST students, who were
very good at programming. Can you please help him?
Input Format: Input consists of an integer.
Output Format: Output consists of the corresponding month and “There is no
month for this number” if the input is not in range between 1 and 12.
b. Write a C program using switch case to accept any single digit number and print
it in words.
52.a. THE CWG 2010 committee is bored with the usual long jump, high jump and
triple jump and they have decided to introduce a new game called staircase
climbing. The players need to climb a staircase. There are ‘n’ steps and each step is
1 meter higher than the previous one. The player who first reaches the top of the
staircase will be declared as the winner. The audio-visual committee is responsible
for placing pans and tilt cameras at all locations and one of their main objective is
to capture the winning moment in all the games. They were pondering on where to
place the camera for capturing the winning moment of the staircase climbing game.
Finally, they decided on placing the camera at the same height as the top of the
staircase. Given the number of steps 'n' and the height of the first step 'h', write a C
program to find the position where the camera needs to be placed.
Input Format: The input consists of 2 integers which correspond to n and h.
Output Format: Output consists of a single integer
b. Write a C program to print the series 1,4,7,10.... upto n terms.
53.a. A system checks whether the entered username and password are correct
before granting access. If the credentials match, access is allowed; otherwise,
access is denied. give answers for the above question using c program.
b. Write a C program to generate numbers between the given range and print the
numbers which are divisible by 2 and not divisible by 3 and 5.
54.a. Imagine you are working on a program for a math teacher who frequently
needs to swap two values for various calculations. The teacher asks you to create a
function that swaps two values (e.g., two numbers) using the Call by Value
method.
b. Write a ‘C’ Program using for loop to find the largest digit of a number.
55.a. Kavin was travelling from chennai to Hyderabad in car. The train has arrived
at the destination later than the estimated time due to inclement weather condition.
So, Kavin wants to know total number of hours and minutes the car was late. Help
him find using a C program Note: hrs=tot_min/60; min=tot_min%60.
b. Write a C program that accepts two item's weight and number of purchases
(floating point values) and calculates their average value.
56.a. Kaviya’s 6th birthday is coming in a week, her mother promised her that if
she find’s the total number of vowel in her name she will be gifted with a violin.
Help her to find the total number of vowels with the help of C program.
b. Write a C program to get the details of the student (roll no, name, date of birth,
state, 10th percentage and 12th percentage) using structure. Calculate the age of
the student and display the eligibility status for his admission. a. Eligibility criteria:
more than 60 percent in 10th and 12th, age>=17, state==TN
57.a. Numbers are displayed from 1 to 100 in a board .find the total of even
numbers and odd numbers using separate function.
b.Write a C program to create an employee Union with employee details (id, name,
salary) Accept the details of 'n' employees, rearrange the data in ascending order of
employee name, id and salary as three different functions and display it.
58.a. Rekha has completed her 10th board exams, she has to submit her overall
percentage along with next year’s application , help her to find the overall
percentage using c program.
b.Write a menu driven C program for library management system with ten entries:
a. (i). Add Book (ii). Add Author (iii). Add Category (iv). Book Cos (v). Display -
Book by Author, Book by Category, Book under cost
59.a. Book fair is conducted in school if a person buys 1 book the cost is 300, if the
person buys 2 books Rs.10 will be reduced from total cost, if a person buys 3
books Rs.20 will be reduced from total price,if a person buys 4 books Rs.30 will be
reduced from total bill and if a person buys more than 5 books Rs.60 will be
reduced from total price. Write this condition with the help of C program using
switch case.
b. Write a Program to Swap the values of two variables
60.a. Write a c program to find how many alphabets, numbers and special symbols
in the given string String=Cse@^10.
b. Write a Program to Calculate the Sum of Natural Numbers using recursion.