PPS GTU Question Bank
PPS GTU Question Bank
Module-2 Fundamentals of C
No Question Marks Year Book
List all operators used in C and explain any three with example.
OR 7 W-18
List out the operators used in C language and explain any three with
Example. 4 W-19
OR 7
1 Explain different categories of operators available in C programming 7 S-20
OR W-21
Explain different type of operators used in c language with their 7 S-22
Precedence and associativity. S-23
AND
Describe precedence and associativity of operators with example
AND
Explain the working of various bit-wise operators with the
example.
OR
List out all operators and explain any two in details.
2 Describe local and global variable with example. 3 W-18
What do you mean by type conversion? Give example.
OR 3 W-18
3 Explain type conversion and type casting with example. 4 S-20
OR 3 S-22
Explain type casting with example (2) S-23
What are header files? Name at least 3 with its usage (2)
OR S-19
3
Show the important of stdio.h header file. W-19
5 4
OR S-20
List any three header file with its usage. S-23
6 What is formatted output? Using printf() statement explain it. 3 S-19
Distinguish the data types provided by C programming language.
OR 4 W-19
7
Explain four basic data types in C and provision to extend range for 4 S-20
appropriate data types. 7 W-22
OR
List and explain different data types available in C.
8 What do you mean by enumerated data type in C language? 1 S-22
Implement a C Program to convert temperature from Fahrenheit to
9 7 W-19
Celsius and vice versa.
OR S-23
Write a C program to compute Fahrenheit from centigrade (f=1.8*c
+32).
10 Explain different types of constants. 4 W-19
11 Justify, 2 and ‘2’ both are not same in C language 1 S-22
12 What is the role of sizeof operator in C language? 1 S-22
OR W-22
Demonstrate the working of bitwise shift and sizeof operator with an 3 W-23
example.
OR
Demonstrate the use of bitwise operators with an example.
Ternary operator can be nested. (True/False)
1
13 AND S-22
3
Explain ternary (?:) operator in detail with the example (2) W-23
Write the outputs of the following expression:
i) 50 % 2 / 3 + 2
14 3 S-22
ii) 21 / (int) 2.5 + 3
iii) (1 > 2 ) || ( 2 < 3) && 5 < 1
15 Find out error(s), if any in the following code 4 W-22
and correct it:
int main() {
printf(“%f %d”, 7.0%5.0, 5 || -2);
}
16 Write a C program to check whether a three digits number is 7 S-23
palindrome or not.
17 Give the output of following C code. 3 W-23
int main(){
printf(“%d”, 15<2);
printf(“%d”, 15&&2);
printf(“%d”, 7%10);
return 0;
}
18 Explain C tokens in detail. 7 W-23
OR
Write a C program to print following pattern using loop.
5
44
333
2222
11111
OR
Construct a C program to print following pattern
1
23
456
7 8 9 10
11 12 13 14 15…..
Demonstrate a C program to input an integer number and check last
12 7 W-19
digit of number is even or odd.
13 Write a program to find sum of first N odd numbers. Ex. 7 W-19
14 1+3+5+7+… ...... +N
Develop an algorithm to print first N Fibonacci numbers
W-19
15 OR 4
S-22
Write a program to print Fibonacci series.e.g.0, 1, 1, 2, 3, 5, 8, 13.
16 Write a C program to find factorial of a given number. (2) 7 S-20
W-22
17 Write a C program to find 1+1/2!+1/3!+1/4!+. ... +1/n!. 7 S-20
Write an algorithm for finding odd and even number from given
18 3 W-21
two numbers.
Write a C program to check whether the entered character is
19 7 W-22
alphabet, digit, space or any special character.
Find out error(s), if any in the following code and correct it:
20 3 W-22
int main() {
if(10%2==0){
break;
}
}
Examine following code and give output of it.
21 4 W-22
void main(){
int a=0;
while (a<10) {
a++;
if (a%3==1) {
continue;
}
printf (" %d", a);
}}
Examine following code and give output of it.
22 void main(){ 4 W-22
int i=1;
for (i=10; i>=1 ; --i) {
printf (“ %d”, i);
i--;
}
}
Write a C program to make sum of digits of a given number. (if input is
23 145, output should be 10) 7 W-22
Demonstrate the use of forward jump and backward jump with an
24 example. 4 W-23
Give the output of following C codes.
25 1. int main(){ 4 W-23
int i=10;
while(i<10){
printf(“%d”, i);
i++;
}
return 0;
}
2. int main(){
int i=10;
do{
printf(“%d”, i);
i++;
}while(i<10);
return 0;
}
Debug the following codes and show the output for this:
26 For ( i=0 ; i<=50 ; i++ ); 3 S-24
{
printf( “\n %d” , i )
}
*consider header files and declaration of variable is done.
Module-5 Functions
No Question Marks Year Book
1 What is UDF? Describe advantages of UDF. 3 W-18
Classification of User defined function’s components (elements)
OR 4 W-18
2 Categorize User defined function’s components (elements). 4 W-19
OR 7 W-21
Describe different categories of user-defined functions. 7 W-22
OR
Describe categories of User defined function
Create a function to check number is prime or not. If number is prime
then function return value 1 otherwise return 0.
OR W-18
Build a function to check number is prime or not. If number is prime
then function return value 1 otherwise return 0. W-19
OR 7
3
Write a function in the program to return 1 if number passed is prime S-20
otherwise return 0. (2)
OR W-21(2)
Write a program to check whether entered number is prime or S-23
not with the help of user-defined function check-prime(). (2)
OR S-24
Write a C program to check whether a number is prime or not. (2)
4 Discuss parameter passing technique used in C with example. 4 W-18
5 Create a function to swap the values of two variables. 7 W-18
Write a program to calculate nCr using user defined function. nCr = n! /
6 7 S-19
(r! * (n-r)!)
7 In user defined function, what is actual argument and formal argument? 3 S-19
Explain the function definition, function prototype and function call
7
with relative example. W-19
8
OR 1
S-22
What do you mean by function prototype?
Explain call by value (pass by value) and call by reference (pass by W-19
Reference) with examples in brief. S-20
OR 7 S-22
9 What is user defined function? Explain pass by value and pass by 3 W-22
reference in functions with example. S-23
OR 4 W-23
Differentiate call by value and call by reference. (3)
OR
What is function? Differentiate: Call by value and Call by reference.
Develop a menu-based program to perform addition, multiplication,
10 7 W-21
subtraction and division using user-defined function.
11 Differentiate function and macro. 3 S-22
12 Write a C program to find sum of digits for a given number using the 7 W-23
concept of User Defined Function (UDF). (Hint: For number 3278, sum of
digits is 3+2+7+8 = 20)
13 List the categories of User Defined Functions and Discuss any one of 4 S-24
these.
14 Construct a C program which used a user define function that receives an 7 S-24
integer and returns square and cube of it and prints in main function.
Module-6 Recursion
No Question Marks Year Boo
k
Define recursion. List the advantages of recursion.
4 W-18
1 OR
4 W-19
List the advantages of recursion.
What is recursive function? Explain with suitable example. (2) S-19
7
2 OR S-22
1
What do you mean by recursion? W-22
OR 3
W-23
Demonstrate the use of recursion with an example.
What care must be taken while writing a program with recursive function?
OR 4 S-19
3
What do you mean by recursive function? What care must be taken 3 W-21
while writing a program with recursive function?
4 Explain problem solving using recursion with any example 4 S-20
5 Write a recursive program to find factorial of a given number. 7 S-22
OR S-23
Write a C program to find factorial of a number using recursion.
6 Write a C program to generate first n number of Fibonacci series using 7 S-23
recursion.( 0 1 1 2 3 5 8…)
Module-7 Pointers
No Question Marks Year Book
What is pointer? Explain with example to print the address of variable
using pointer.
3 W-18
OR
1 What is pointer? Explain with example to store and print the address of
3 S-20
variable using pointer
1 S-22
OR
What is a pointer?
What is pointer? Which arithmetic operations are not valid on pointers?
4 S-19
2 AND
S-19
What is pointer? Which arithmetic operations are valid on pointers?
Explain array of pointers with suitable example.
4 S-19
3 OR
3 S-22
What is meant by array of pointers? Explain it with example
What is pointer to pointer? Write suitable example to demonstrate the
concept.
4 S-19
4 AND
3 W-21
What is pointer? Explain how pointers are declared and
initialized. . S-23
OR
What is Pointer in C and how it initializes? State its advantages.
5 Give the output of following C code. 3 W-23
int main(){
int val=20, *p;
p = &val;
printf(“%d %d %d”, val, *p, sizeof(p));
return 0;
}
6 Write True / False against following statements: 3 S-24
1) Pointer is a variable which holds address of location where value of
other variable is stored.
2) Pointer holds the address in form of float or integer.
3) The address of a variable can be stored in two or more pointers.
7 What are the arithmetic operators that are permitted on pointers? 3 S-24
Module-8 Structure
No Question Marks Year Book
Define a structure data type called time_struct containing three
member’s integer hours, minutes, second. Develop a program that
1 7 W-18
would assign values to individual member and display the time in
following format : HH:MM:SS
What is structure? How to access the elements of structure? How to
7 W-18
2 calculate size of structure? Explain with example.
Explain how structure variable is initialized with suitable example.
OR
4 S-19
Show structure declaration and initialization with proper syntax
3 S-20
OR
3 W-21
What is structure? Explain with example how to declare a structure
and how to initialize it.
4 Explain with suitable example structure variable and pointer to structure 4 S-19
variable.
Distinguish between Structure and Union.
W-19
5 OR 3
S-22
Define Union in ‘C’ with example. 4
OR W-22
Compare structure and union. (2)
OR S-23
What is structure? How it is different from union? Explain W-23
nestedstructure with example.
Define a structure “personal” that would contain person name, date of
6 joining and salary. Using this structure read information of 5 people and 7 S-20
print the same on screen. Also display sum of salary of all 5 people. S-23
OR
Define a structure type struct personal that would contain person name,
date of joining and salary using this structure to read this information of
5 people and print the same on screen.
Ch. Win18 Sum19 Win-19 Sum20 Win-21 Sum- Win-22 S-23 W-23 S-24 Total
22
Ch- 1
Ch- 2
Ch- 3
Ch- 4
Ch- 5
Ch- 6
Ch- 7
Ch- 8
Ch-9
Ch-10
Total
My Strategic Chart: