PPS - W2022 (3110003) (GTURanker - Com)

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Seat No.: ________ Enrolment No.

___________

GUJARAT TECHNOLOGICAL UNIVERSITY


BE - SEMESTER–I & II(NEW) EXAMINATION – WINTER 2022
Subject Code:3110003 Date:07-03-2023
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) List out and briefly explain basic building blocks of Computer system. 03
(b) Describe various symbols used for preparing flow chart. 04
(c) List and explain different data types available in C. 07

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)

Q.4 (a) Difference between call by value and call by reference. 03


(b) Explain the concept of recursion with an example. 04
(c) Write a C program to make sum of array elements. 07
OR
Q.4 (a) Briefly explain storage class auto and extern. 03
(b) Explain switch statement with an example. 04
(c) Write a C program to sort an array in ascending order. 07

Q.5 (a) Give the significance of getc(), getw(), fscanf(). 03


(b) Compare structure and union. 04
(c) Describe categories of User defined function. 07
OR
Q.5 (a) List down and briefly explain methods for dynamic memory allocation. 03
(b) Write a C program to copy content of one file to other with the help of file 04
handling functions.
(c) Explain any four string handling functions with an example. 07

You might also like