Exam Seat Number:_______________
THE MAHARAJA SAYAJIRAO UNIVERSITY OF BARODA
SS BE-I (CRS) Examination
CSE1202CS: Programming in C and C++ -CSE
Date: 23rdApril 2024(Tuesday) Marks: 100
Time: 11:30 AM to 02:30 PM
Instructions:
Use separate answer sheets for different [Link] example(s) wherever required. You may
write your assumption, if any, while answering a specific question. Correct the syntax error in
the code given for output, if any; then give output. (i.e., assume that there is no error).
SECTION – I
Q-1 Do as directed (ANY FIVE). [10]
A. Classify the following variable declaration/name as valid or invalid.
int 99Acre;
int Total100;
char cellphone[10][5];
float name[5, 20];
B. Explain Ternary Operator with suitable example.
C. What is the output of the following code?
{ int i=5, j=5 x, y; x=++i; y=j++; printf(“%d %d”, x, y); }
D. What is Algorithm? Write an algorithm to print maximum number out of two
given numbers.
E. Differentiate: Compiler and Interpreter.
F. What is the output of the following code?
{ int a=5;
for(;a<15;)
{ printf(“\n %d”, a);
if (a>10) break;
a++;
}
}
Q-2 Answer the following (ANY FOUR): [20]
A. Draw a flowchart to print first ten natural numbers, 1 to 10.
B. Explain for loop with sutibale example.
C. Explain the concept of pointer with example.
D. Write a program to find and print maximum out of given three numbers.
E. Discuss the various steps in program execution.
Q-3 Explain the following concepts in detail with suitable example (ANY TWO). [20]
A. Arithmetic, relational, and logical operators in C.
B. One-dimensional and two-dimensional arrays.
C. Pointer to Structure.
Page: 1 of 1
Exam Seat Number:_______________
SECTION – II
Q-4 Do as directed (ANY FIVE). [10]
A. What is the output of the following code?
{ int a=5, b; b=a++ + ++a; printf(“%d %d”, a, b); }
B. Discuss the concept of local variable and global variable.
C. What is the output of the following code?
{ int a=5, b=10, c=15, d; d=a>b && b>c; if (d) printf(“0”); else printf(“1”); }
D. What is the output of the following code?
{ int a=5, b=10, *c=&a, *d=&b, **e=&c, **f=&d; *c=b; *d=a;
printf(“%d %d %d %d %d %d”, a, b, *c, *d, **e, **f); }
E. Is it possible to define a function/method outside of the class in C++? How?
Q-5 Answer the following (ANY FOUR). [20]
A. What is recursion? Write a code to find N! using recursion.
B. Write a C program to print the following pattern:
*****
****
***
**
*
C. Explain the meaning of following keywords in C++: private, public, protected.
D. Discuss the concept of function overloading in C++.
E. Explain the concept of Constructor and Destructor in C++.
Q-6 AnswerANY TWO from the following. [20]
A. What is dynamic memory allocation? Write a program to accept five numbers
from the user and to print its sum using a pointer to integer (without using array).
B. Explain any five built-in string functions with examples.
C. Discuss the concept of Multilevel and Multiple Inheritance with suitable example.
Page: 1 of 1