Seat No.: ________ Enrolment No.
___________
GUJARAT TECHNOLOGICAL UNIVERSITY
BE - SEMESTER–1/2 EXAMINATION – WINTER 2021
Subject Code:3110003 Date:24/03/2022
Subject Name:Programming for Problem Solving
Time:10:30 AM TO 01:00 PM Total Marks:70
Instructions:
1. Attempt all questions.
2. Make suitable assumptions wherever necessary.
3. Figures to the right indicate full marks.
4. Simple and non-programmable scientific calculators are allowed.
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
(c) Explain different type of operators used in c language with their 07
precedence and associativity.
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.3 (a) Write a program to check whether entered character is vowel or 03
not?
(b) Explain getch(), getchar(), gets(), puts() . 04
(c) Develop a menu-based program to perform addition, multiplication, 07
subtraction and division using user-defined function.
OR
Q.3 (a) Write an algorithm for finding odd and even number from given 03
two numbers.
(b) Write a program to check whether entered number is prime or 04
not with the help of user-defined function check-prime().
(c) Write a program to find out the largest of an array. 07
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().
********