Enrolment No.
/Seat No_______________
GUJARAT TECHNOLOGICAL UNIVERSITY
BE - SEMESTER–I & II (NEW) EXAMINATION – SUMMER 2024
Subject Code:3110003 Date:12-07-2024
Subject Name:Programming for Problem Solving
Tim[Link] PM TO 05: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) Draw neat Block Diagram illustrating the Anatomy of a Computer System. 03
(b) Illustrate an Algorithm to check whether the given year is leap year or not. 04
(c) Define Flow chart, List the rules for designing a Flow chart and Rephrase the 07
merits and demerits of flow chart.
Q.2 (a) List the rules to assign a name to an Identifier (Variable) 03
(b) Illustrate the basic structure of a C Programs and highlight usual sections of 04
main function.
(c) Construct a C program which receives number of days as input and converts 07
them in to Year, Months and Days,
OR
(c) Construct a C program to swap the values of two integers with use of only 07
two variables.
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 )
}
*consider header files and declaration of variable is done.
(b) Explain nested if-else statement with suitable example. 04
(c) Construct a C program to print following pattern 07
1
23
456
7 8 9 10
11 12 13 14 15…..
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:
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) List the categories of User Defined Functions and Discuss any one of these. 04
(c) Construct a C program which used a user define function that receives an 07
integer and returns square and cube of it and prints in main function.
OR
Q.5 (a) What are the arithmetic operators that are permitted on pointers? 03
(b) Show the use of Malloc, Calloc, Free and Realloc in context of Dynamic 04
memory allocation.
(c) List and discuss file handling functions used in C. 07
*************