Professional Documents
Culture Documents
Q.1 Write a C program to create a record of 10 student's detail using an array of (5,5)
structure, with four fields (roll_number, name, marks, grade). Assign
appropriate data type to each field. Write a code that displays the details of
a student for a given roll_number. If the roll_number is not found then display
a message "Student details are not found in the database".
Q.2 Write a C program to read the name and marks of n number of students (4,6)
from user and store them in a text (.txt) file.
Q.3 Write a C program to check whether a given integer number is palindrome (10)
or not.
Q.4 Write a program which takes a matrix of order 3x3 from the user and (4,6)
computes the transpose of that matrix.
Q.5 Guess a number between 1 and 100 in your mind. Write a program so that (20)
the computer will ask you a series of questions and determine that number
based on your answers.
Hint:
• Use two variables: low = 1 and high = 100
• Compute mid = (low + high) / 2
• Ask the user: Is it mid?
• Get user response ('<','>' or '=').
• Adjust low or high based on response
• Repeat as needed
Q.6 Write a C program to count total number of words in a string using looping (10)
instruction.
Q.7 Explain the storage classes used in C language and demonstrate each using (2.5*4)
suitable example.
PTO
Q.8 Differentiate between the following with suitable examples : (5,5)
i) Formal and actual parameters
ii) Call by Value and Call by Reference
Q.9 Given two strings sl="Welcome" and s2="Thapar". Write a program in C to (10)
concatenate (user defined function) these two given strings and store
results in third sting s3, such that s3 ="Welcome Thapar".
Note: Don't use the function strcat().
PTO