22 non core
22 non core
A
7. i) Write aC program to sort a
JGEC/B.TECHL/CSE/ECE/IT/ES-CS201/2021-22
2022
PROGRAMMING FOR PROBLEM SOLVING
GROUP-A
[OBJECTIVE TYPE QU ESTIONS]
5x2=10
us
f
r
int a=3, b;
b= JGEC(a + 2);
printf(“\n%d”,b);
}
What will be the output?
a)101 b)5 oc)25_ d)none ofthese
5. Which operator can be used to access Union data members if the Union data is
accessed using union to
pointer variable?
. GROUP-B
[LONG ANSWER TYPE QUESTIONS]
ii) What is macro? What is the difference between macro and C function?
jii) Write a C program to check whether a string is palindrome or not without using
string header file.
5+(2+3)+5
ii) Write down the difference between array of character and string? Explain with
suitable example the mechanism
PTO
10.
11.
ii) Write a C program to search an element from a given array using binary searc
be taken from user.
5+5+5
1) Define a structure called cricket that will describe
player name,
team name,
batting average
age F
Using cricket, declare an array player with 50 elements and write a program to read
the information
about all the 50 players and display them
ii) Calculate the total required memory of the structure cricket that you have
created.
iii) Differentiate between structure and union.
iv) What is self-referential structure? Give an example of unary operator.
74+243+3
i) Write a program to calculate and display the truth table of all the unique
Boolean functions of two variables.
li) Write a C program to print the following pattern
54545
4545
$45
45
5
iii) What are auto, external and static variables? Explain their uses with suitable
examples. pee
i) What is pointer? What do you mean by pointer arithmetic?
ii) Write a C program to interchange two integer numbers using call by reference.
iii) Write an user friendly C program to create a link list by inserting the
elements from the beginning.
What is the difference between malloc and calloc?
(24+3)+54372
END