You are on page 1of 2

Seat No.: ________ Enrolment No.

: __________
VPMP POLYTECHNIC, GANDHINAGAR
DIPLOMA IN COMPUTER ENGINEERING –

Mid Semester Examination-SEMESTER- 1

Subject Name: COMPUTER PROGRAMMING Subject Code: 3310701


Date: 04 -03 -2021 Time: 01:15 PM TO 03:45 PM
Total Marks: 60
Instructions:

1. Attempt any 3 questions out of first four questions.


2. It is compulsory to attempt Question 5.
3. Make suitable assumptions wherever necessary.
4. Figures to the right indicate full marks.
પ્રશ્ન પ્રશ્ન Remarks માર્ક
Q. 1 Answer the following questions.(7 out of 10) 14
1 _____ is not a keyword of C programming language. 2
(A) array (B) if (C) continue (D) void
2 If the equation in c program is: ans = 3 + 2 * 3 – 2 / 2 + 3 , then calculate 2
the value of ans.
(A) 12 (B) 15 (C) 11 (D) 17
3 The _______ symbol is used to represent process in flowchart. 2
(a)Circle (b)Rectangle (c)Diamond (d)None of these
4 The precedence order (from highest to lowest) of arithmetic operators is 2
(a) %, *, /, +, –
(b) %, +, /, *, –
(c) +, -, %, *, /
(d) %, +, -, *, /
5 Find the correct output of the following code. 2
main( )
{ int x = 3%2, y = 3/2;
if (x = = y)
printf(“One is true ”);
else
printf(“One is false”);
}
(A) One is true (B) One is true One is false (C) One is false (D) Error because
of misplace else
6 Which statement is used for unconditional branching in C? 2
(a) if (b) for (c) goto (d) switch
7 List out Bitwise Operator in C Language. 2
8 What is Volatile variable? How do you declare it? 2
9 List out categories of operators in C Language. 2
10 What is the difference between ++a and a++ ? 2
Q. 2 Answer the following questions. 14
A Differentiate: entry-controlled loop vs exit-controlled loop 3
OR A Write a C program to interchange the value of two integer variables. Input 3
values from keyboard.
B Rewrite the following code with conditional operator. 3
if (x % 5 == y / 4)
z = sum / n + 1;
else
z = n / sum – 1;
OR B Draw a flowchart to check whether the given input is odd or even. 3
C Explain the syntax of switch…case statement with example.
OR C Write an algorithm to input three numbers and find the sum and average 4
of them.
D Explain printf statement in C with example. 4
OR D Write rules for naming a variable. 4
Q. 3 Answer the following questions. 14
A Explain for loop statement with example in C 3
OR A Write an algorithm to find whether year is leap year or not. 3
B Explain different symbols of flowchart. 3
OR B Define an array. List out the characteristics of an array. 3
C Define following with examples. 4
(i) Keyword (ii) Identifier (iii) Token (iv)constant
OR C What is variable? Explain declaration and initialization of variable with 4
example.
D Explain Enumerated Data Type with example. 4
OR D Explain forward and backward jump in a program using goto statement. 4
Q. 4 Answer the following questions નીચેના પ્રશ્નોના જવાબ આપો 14
A Explain ternary operator with suitable example. 3
OR A List out data types with their range of value used in ‘C’. 3
B What is the difference between puts() and putch() ? 4
OR B Explain relational and logical operators in C with example. 4
C Explain conditional branching. List its types and explain any one with 7
syntax and example
Q. 5 Answer the following questions. 14
A Explain bitwise operators with example. 4
B Write a program to print the following series using for loop. 4
1
22
333
4444

C Explain while loop statement in C with example. 5


OR C Write a program to print following pattern using loop. 5
*
**
***
****
D Explain nesting of loops in C. 5
OR D Write a C program to find sum of 5 integer numbers using an array. 5

*****BEST OF LUCK*****

You might also like