CS3251 Programming in C _QB
CS3251 Programming in C _QB
in
CS3251 PROGRAMMING IN C
IMPORTANT QUESTIONS AND QUESTION BANK
UNIT-I BASIC OF C PROGRAMMING
2-Marks
n
1. What are the various types of operators?
e.i
2. Write a for loop to print from 10 to 1?
3. Write any two preprocessor directives in C?
4. List different datatypes available in C?
5. Write a C program to find factorial of a given number using Iteration?
fre
6. What is the use of preprocessor directive?
7. What is the variable? Illustrate with an example?
8. Define static storage class?
9. What is the importance of keywords in C?
10. List out various Input & output statements in C?
tes
Part-B
No
chapter?
6. Write Some of the predefined macros which are readily available?
7. What are the preprocessor directives are divided into four different categories?
8. Explain about the details in preprocessor directive?
ww
9. Write a note on (i) Conditional operator (ii) Assignment Operators (iii) Bitwise
operators?
10. Explain about the Logical operators and relational operators?
11. Illustrate about the various data types in ‘C’ and write a C program to find the sum
of 10 non-negative numbers entered by the user?
12. Explain the purpose of decision making and looping statement Explain in detail the
operation of various looping statements in C with suitable examples?
13. Write short notes on the following (i). ‘for’ loop (ii). ‘while’ loop (iii). ‘do…while’ loop?
14. Illustrate a program for adding two numbers with the help of flowchart?
15. Discuss about pseudo code and explain with an example? Write a C program to
generate Armstrong number between 100 and 999?
www.Notesfree.in
www.Notesfree.in
2-Marks
n
1. List out the features of Arrays?
2. Identify the way to assign an array to another array?
e.i
3. What is an array? Write the syntax for array?
4. What will happen when you access the array more than its dimensions?
5. Point out an example code to express two dimensional array?
6. Is address operator used in scanf() statement to read an array? Why?
7.
int main ()
{
char str[8]="Include Help";
fre
What will be the output of following program? #include <stdio.h>
printf("%s ,str);
return 0;
tes
8. List out the any four functions that are performed on character strings?
9. Specify any two methods of sorting?
10. How to initialize a string? Give an example?
No
Part-B
1. Explain the need for array variables. Describe the following with respect to arrays.
Declaration of array and accessing an array element? Write a C program to re-
order a one-dimensional array of numbers in descending order?
w.
2. Write a C program to multiply two matrices (two dimensional array) which will be
entered by a user. The user will enter the order of a matrix and then its
elements and similarly input the second matrix. If the entered orders of two
matrices are such that they can’t be multiplied by each other, then an error
ww
www.Notesfree.in
www.Notesfree.in
11. Write a C program to find whether the given string is palindrome or not without
using string functions?
12. Illustrate with an example of command line arguments?
13. Write a C program to find average marks obtained by a of 30 students in a test?
14. Write a C program to perform the following matrix operations (i)Addition (ii)
subtraction (iii)multiplication
n
15. Write a C program to simulate strcpy function?
e.i
UNIT-III FUNCTION AND POINTERS
2-Marks
fre
1. Define function. How will you declare it?
2. What are the various parts of functions?
3. What is function cell?
4. What is recursion?
tes
5. Differentiate between call by value and call reference?
6. Why is scope of variable necessary in function?
7. Identify the use of functions?
8. What is meant by library function?
9. What is a function call? Give an example of a function call?
No
Part-B
1. Describe about functions and their operations that can be performed on it?
2. What are the different types of functions? Explain in detail with example?
ww
www.Notesfree.in
www.Notesfree.in
11. Write the C program to find the value of sin(x) using the series up to
the given accuracy (without using user defined function) also print sin(x)
using library function?
12. Write a C program for Scientific calculator using built-in functions?
13. What is difference between pass by value and pass by reference? Write the C
coding for swapping of two numbers using pass by reference?
14. Explain about any 4library functions in c?
n
15. Develop a C program for binary search using recursive function?
e.i
UNIT-IV STRUCTURE AND UNIONS
2-Marks
1.
2.
3.
fre
What is structure? Write the syntax for structure?
How the members of structure object is accessed?
How typedef is used in structure?
4. Mention any two ways passing structures and functions?
5. Show the difference between Structures from Array?
tes
6. Show an example program using union?
7. Discriminate copying and comparing operation on structures.?
8. If we have structure B nested inside structure A, when do we declare structure
B?
No
Part-B
w.
books in a library and display the total cost of the books and the book
details whose price is above Rs.500?
5. What is a structure? Express a structure with data members of various types and
declare two structure variables. Write a program to read data into these and print
the same? Justify the need for structured data type?
6. Does structure bring additional overhead to a program? Justify? Write short note
on structure declaration?
7. How to access enumerated datatype and explain with an example program?
Referencing pointer to another address to access the memory?
8. Explain with an example the self-referential structure?
9. Explain nested structure and write C Program to Implement the same?
www.Notesfree.in
www.Notesfree.in
10. Illustrate a C program to store the employee information using structure and search
a particular employee detail?
11. Define a structure called student that would contain name, regno and marks of five
subjects and percentage. Write a program to read the details of name, regno
and marks of five subjects for 30 students, calculate the percentage and display
the name, regno, marks of the subjects and percentage of each student?
12. Write a structure to store the name, account number and balance of customers
n
(more than 10) and store their information. Write a function to print the names of all
the customers having balance less than $200?
13. Compare and contrast between Structures and Unions?
e.i
14. Examine the differences between nested structures and arrays and structure?
15. Develop a C Program to use the arrays inside union variables?
Part-B
2. What is command line arguments? Write an example program for command line
arguments?
3. Write short notes on fseek()? Give an example for fseek()?
4. Explain about files and with it types of file processing?
5. Explain the details in Explain about files and with it types of file processing?
6. Write a C program to read name and marks of n number of students from user and
store them in a file?
7. Write a C program to read name and marks of n number of students from user and
store them in a file. If the file previously exits, add the information of n students?
www.Notesfree.in
www.Notesfree.in
8. Write a C program to write all the members of an array of structures to a file using
fwrite(). Read the array from the file and display on the screen?
9. Describe command line arguments with example C program?
10. Explain about the random access? And gibe the properties of file operating?
11. Explain about current line arguments?
12. Write a note on Ordinary Files or Simple File and Directory files?
n
13. Determine the Compare sequential access and random access?
14. Write short notes on ferror(). ferror()?
e.i
15. (i) Write short notes on fscanf (). (ii) Write short notes on fprintf ().?
fre
tes
No
w.
ww
www.Notesfree.in
Civil
www.Notesfree.in CSE
Home Mech
e
EEE
CSE –2nd sem Reg 2021 ECE
n
Computer Organization
Engineering Graphics
Engineering Physics
e.i
Foundation of Data
Physics for Information
Science Science
Engineering Chemistry
Physics
Basic for Engineering
Electrical and Data Structure
Problem Solving and
fre
Science Engineering
Electronics
Python Programming Object Oriented
Programming in C
Programming
Cryptography and
Database Management Cyber Security Open Elective I
System
Professional Elective III
Algorithms Distributed Computing
Professional Elective IV
Professional Elective I
w.
Elective-Management
Professional Elective II
Professional Elective IV
www.Notesfree.in