PPS GTU Papers
PPS GTU Papers
___________
1
Seat No.: ________ Enrolment No.___________
Q.2 (a) What are header files? Name at least 3 with its usage. 3
(b) Write a program to find 1+1/2+1/3+1/4+....+1/n. 4
(c) What is a string? Explain at least 4 built-in string functions with example. 7
OR
(c) What is an array? Explain one dimensional and two dimensional array declarations
7
and initialization with suitable example.
Q.3 (a) What is formatted output? Using printf() statement explain it. 3
(b) Write a program to check whether entered character is vowel or not? 4
(c) Write a program to print all Armstrong numbers in a given range. Armstrong
number is equal to sum of cubes of its individual digits. For example 153 = 1^3 + 7
5^3 + 3^3. So, 153 is Armstrong number.
OR
Q.3 (a) Why it is necessary to give the size of an array in array declaration? 3
(b) Explain break and continue with suitable example. 4
(c) Write a program to display transpose of given 3*3 matrix. 7
Q.4 (a) What is pointer? Which arithmetic operations are not valid on pointers? 3
(b) Explain array of pointers with suitable example. 4
(c) Write a program to calculate nCr using user defined function. nCr = n! / (r! * (n-r)!) 7
OR
Q.4 (a) What is pointer? Which arithmetic operations are valid on pointers? 3
(b) What is pointer to pointer? Write suitable example to demonstrate the concept. 4
(c) What is recursive function? Explain with suitable example. 7
Q.5 (a) What care must be taken while writing a program with recursive function? 3
(b) Explain how structure variable is initialized with suitable example. 4
(c) What are command line arguments? Explain with suitable example. 7
OR
Q.5 (a) In user defined function, what is actual argument and formal argument? 3
(b) Explain with suitable example structure variable and pointer to structure variable. 4
(c) What is dynamic memory allocation? Explain important functions associated with
7
it.
*****************
1
Seat No.: ________ Enrolment No.___________
MARKS
***********
Seat No.: ________ Enrolment No.___________
Marks
Q.1 (a) Explain different symbols used in flowchart. 03
(b) Write algorithm or flowchart for finding maximum out of three numbers 04
entered by user.
(c) Explain different categories of operators available in C programming. 07
Q.2 (a) Explain entry controlled and exit controlled loop with proper syntax. 03
(b) Explain 1) nested if-else statement 2) break statement. 04
(c) Write a program to store 10 elements in array given by user and to find 07
maximum out of those 10 elements.
OR
(c) Write a program to find a character from the string, string and character to 07
be searched both will be given by user.
*******************
2
Seat No.: ________ Enrolment No.___________
Marks
Q.1 (a) Define following terms: 04
1) Application Software 2) System Software
3) Algorithm 4) Flowchart.
(b) Draw the flow chart to find the largest of the given three numbers – 03
A ,B and C
Q.2 (a) Discuss use of break and continue statement in C with example. 03
(b) Compare and contrast while and do while loop with example. 04
(c) Write a C program to print following pattern. 07
1
2 2
3 3 3
OR
(c) Write a C program to print following pattern. 07
1
2 3
4 5 6
Q.4 (a) What is structure? Explain with example how to declare a structure 03
and how to initialize it.
(b) Explain following string manipulation function. 04
strcat( ), strcpy( ) ,strcmp( ) and strlen( )
(c) Write a program in c for multiply two matrices A and B of dimensions 07
pXq and qXr respectively and store the result in third matrix C.
OR
1
Q.4 (a) Demonstrate declaration and initialization of two dimensional 03
array with suitable example.
(b) Explain nested if else ladder with suitable example. 04
(c) Write a program in c using structure to enter rollno, marks of the three 07
subject for 3 student and find total obtained by each student
Q.5 (a) What do you mean by recursive function? What care must be taken 03
while writing a program with recursive function?
(b) Explain fopen() and its mode with example. 04
(c) Describe different categories of user-defined functions. 07
OR
Q.5 (a) What is pointer? Explain how pointers are declared and 03
initialized. .
(b) Compare malloc() and calloc() functions for dynamic memory 04
allocation.
(c) Develope a program in C to check the entered number is prime or not 07
by creating a user-defined function named check_prime().
********
2
Seat No.: ________ Enrolment No.___________
Q.1 Mark
(a) Answer the following questions 03
1. Define: Compiler
2. Justify, 2 and ‘2’ both are not same in C language.
3. What is the role of sizeof operator in C language?
(b) Answer the following questions 04
1. Ternary operator can be nested. (True/False)
2. What do you mean by enumerated data type in C language?
3. What is the difference between char *p and char p[]?
4. What do you mean by function prototype?
(b) Answer the following questions 07
1. Define Algorithm.
2. What do you mean by recursion?
3. What do you mean by program and program control?
4. What is a pointer?
5. What is the role of getc( ) and getw() file functions?
6. Programming needs logic building. Justify
7. Define Interpreter.
(c) Explain the working of various bit-wise operators with the example. 07
OR
(c) List out all various string functions and describe them with syntax and 07
example.
Q.3 (a) Explain ternary (?:) operator in detail with the example. 03
(b) Discuss the need of break and continue statements with example. 04
(c) Design a flowchart for checking whether a given number is palindrome or not. 07
OR
Q.3 (a) What is meant by array of pointers? Explain it with example. 03
(b) Write a program to print the triangle shown below. 04
A
AB
ABC
ABCD
(c) Draw block diagram of computer system and explain the functions of each 07
component in detail.
(c) Explain one dimensional array, two dimensional array and multi-dimensional 07
array with their syntax and example.
OR
Q.5 (a) Differentiate call by value and call by reference. 03
(b) Explain structure within structure with example. 04
OR
Q.5 (a) Define Union in ‘C’ with example. 03
(b) Define dynamic memory allocation. Explain malloc() and calloc(). 04
(c) Explain the following File Handling functions: 1. fseek( ) 2. ftell( ) 3. fread( ) 07
4. fwrite( ) 5. fscanf( ) 6. fprintf( ) 7.rewind( )
***********
Seat No.: ________ Enrolment No.___________
Q.2 (a) Demonstrate the working of bitwise shift and sizeof operator with an 03
example.
(b) Differentiate while and do..while loop. 04
(c) Write a C program to check whether the entered character is alphabet, 07
digit, space or any special character.
OR
(c) Write a C program to print following pattern: 07
1
22
333
4444
Q.3 (a) Find out error(s), if any in the following code and correct it: 03
int main() {
if(10%2==0){
break;
}
}
(b) Examine following code and give output of it. 04
void main(){
int a=0;
while (a<10) {
a++;
if (a%3==1) {
continue;
}
printf (" %d", a);
}}
(c) Write a C program to find factorial of a given number. 07
OR
Q.3 (a) Find out error(s), if any in the following code and correct it: 03
int main() {
printf(“%f %d”, 7.0%5.0, 5 || -2);
}
(b) Examine following code and give output of it. 04
void main(){
int i=1;
1
for (i=10; i>=1 ; --i) {
printf (“ %d”, i);
i--;
}
}
(c) Write a C program to make sum of digits of a given number. (if input is 07
145, output should be 10)
2
Seat No.: ________ Enrolment No.___________
Q.2 (a) Differentiate: Exit controlled Loop and Entry controlled Loop 03
(b) Explain: 04
a) switch-case statement
b) continue statement
(c) Write a C program to find factorial of a number using recursion. 07
OR
(c) Write a C program to generate first n number of Fibonacci series using 07
recursion.( 0 1 1 2 3 5 8…)
1
OR
Q.4 (a) List any three header file with its usage. 03
(b) Write a program to print following patterns : 04
1
22
333
4444
(c) Define a structure type struct personal that would contain person name, 07
date of joining and salary using this structure to read this information of
5 people and print the same on screen.
Q.5 (a) What is dynamic memory allocation? Show the use of malloc() and 03
calloc() function with their syntax.
(b) What is structure? How it is different from union? Explain nested 04
structure with example.
(c) Write a C program to check whether a number is prime or not. 07
OR
Q.5 (a) Explain following string handling functions: I. strcat() II. strcmp() III. 03
strlen
(b) What is Pointer in C and how it initializes? State its advantages. 04
*******************************
2
Seat No.: ________ Enrolment No.___________
Marks
Q.1 (a) Write an algorithm to check whether the entered number is Even or Odd. 03
(b) Draw the flowchart to find the factorial of a number given by user. 04
(c) Briefly explain different components of Computer system. 07
1
Q.4 (a) Give the significance of puts(), getchar(), getch(). 03
(b) Differentiate between call by value and call by reference. 04
(c) Write a C program to check whether two strings are same or not. 07
OR
Q.4 (a) Give the output of following C code. 03
int main(){
int val=20, *p;
p = &val;
printf(“%d %d %d”, val, *p, sizeof(p));
return 0;
}
(b) Demonstrate the use of recursion with an example. 04
(c) Write a C program to find sum of digits for a given number using the concept 07
of User Defined Function (UDF). (Hint: For number 3278, sum of digits is
3+2+7+8 = 20)
**********
2
Enrolment No./Seat No_______________
(c) Define Flow chart, List the rules for designing a Flow chart and Rephrase the 07
merits and demerits of flow chart.
Q.3 (a) Contrast the Entry Control loop and Exit Control loop. 03
(b) Construct a C program to find the largest number amongst three integers 04
entered.
(c) Construct a C program to check if entered integer is a prime number or note. 07
OR
Q.3 (a) Debug the following codes and show the output for this: 03
For ( i=0 ; i<=50 ; i++ );
{
printf( “\n %d” , i )
}
1
Q.4 (a) List the types of Array. 03
(b) Summarize the methods for initialization of One-Dimensional array. 04
(c) Construct a C program to multiply 3X3 matrix. 07
OR
Q.4 (a) List the application of gets getchar and puts functions. 03
(b) Summarize the method for Declaration, initialization and Printing on screen 04
of a String.
(c) Define a Structures which contains details of a Cricketer: 07
• Name of Player:
• Team name:
• Total run scored:
• Batting average:
*************
2
Enrolment No./Seat No_______________
Q.3 (a) Differentiate while loop and do..while loop with example. 03
(b) What is type conversion? Explain two types of conversion with examples. 04
(c) Write a C program which takes marks (between 0 to 100) of a student for 07
N subjects. It should print grade of a student based on Percentage of
Student's marks .
"A" for >=85%,
"B" between >=70% and <85%,
"C" between >=50% and <70%,
"PASS" between >=35% and <50%,
"FAIL", if any one subject marks are <35.
1
OR
Q.3 (a) What is function? How Call by value and Call by reference passes the 03
argument in function.
(b) What are the steps in writing a recursive function in a program? 04
(c) Write a program in C to calculate the power of any number using recursion. 07
Q.5 (a) What is a pointer? What are the advantages of using pointer? 03
(b) Explain need of Dynamic Memory allocation. Compare malloc(), calloc() 04
and realloc() functions.
(c) Write a C program to find the sum and mean of all elements in an array 07
using pointer.
OR
Q.5 (a) What is File Pointer? What is significance of File Pointer? 03
(b) Explain signification of following functions in file operations. 04
1. fseek()
2. ftell()
3. open()
4. fread()
(c) Write a C program to read ID and marks of n number of students from user 07
and store them in a file.
****************
2
Enrolment No./Seat No_______________
Marks
Q.1 (a) Write an algorithm to check whether the entered number is Even or Odd. 03
(b) Describe various symbols used for preparing flow chart. 04
(c) Explain different type of operators used in c language with their precedence and 07
associativity.
Q.2 (a) Differentiate: Exit controlled Loop and Entry controlled Loop 03
(b) Explain: 04
a) break statement
b) continue statement
(c) Write a C program to find factorial of a number. 07
OR
(c) Construct a C program to swap the values of two integers with use of only two 07
variables.
Q.3 (a) Demonstrate the use of conditional operator statement with an example. 03
(b) Explain the structure of switch case statement. 04
(c) Write a program to print the triangle shown below. 07
1
10
101
1010
10101
OR
Q.3 (a) Write a program to check whether entered character is vowel or not? 03
(b) Explain getch(), getchar(), gets(), puts() . 04
(c) Write a program to add all the elements of an array. 07
Q.4 (a) What is structure? Explain with example how to declare a structure and how to 03
initialize it.
(b) Explain following string manipulation function. 04
strcat( ), strcpy( ) ,strcmp( ) and strlen( )
1
(c) Define a Structures which contains details of a Cricketer: 07
• Name of Player:
• Team name:
• Total run scored:
• Batting average:
OR
Q.4 (a) Debug the following codes and show the output for this: 03
For ( i=0 ; i<=50 ; i++ );
{
printf( “\n %d” , i )
}
*consider header files and declaration of variable is done.
(b) Summarize the methods for initialization of One-Dimensional array. 04
(c) Construct a C program to add 3X3 matrix. 07
OR
Q.5 (a) Write True / False against following statements: 03
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.
(b) Write a C program to copy content of one file to other with the help of file 04
handling functions.
(c) Develope a program in C to check the entered number is prime or not by creating 07
a user-defined function named check_prime().
*************************