Class Test- 02
RIMIT COLLEGE
Angul
C PROGRAMMING LAB TEST Full Mark:
NAME: ________________________________
ROLL NO.: __________________________
STREAM: _________________________
(Write your answers in the block provided)
1.Fill the Blanks- 5X1
1.The operator && is an example for ___________operator.
2. Operator % in C Language is called _____________
3. The operator / can be applied to _______________.
4. Output of an arithmetic expression with integers and real numbers is
___________________________by default.
5. In mathematics and computer programming, ________________is the
correct order of mathematical operators
2.MCQ- 5X1
1. The equality operator is represented by
a) := b) .EQ.
c) = d) ==
2. 2.The operator + in a+=4 means
a) a=a+4 b) a+4=a
c) a=4 d) a=4+4
3. Choose a correct statement.
int a = 12 + 3 * 5 / 4 - 10 C) 12, 3, 5, 4 and 10 are Operands.
A) 12, 3, 5, 4 and 10 are Operators. +, -, * and / are Operators.
+, -, * and / are Operands.
= is an increment operator. = is an assignment operator.
B) 12, 3, 5, 4 and 10 are Operands. D) 12, 3, 5, 4 and 10 are Operands.
+, -, * and / are Operators.
= is decrement operator. +, -, * and / are Logical Operators.
= is an assignment operator.
4.What will be the output of the program?
#include<stdio.h>
int main()
{
int i=2;
int j = i + (1, 2, 3, 4, 5);
printf("%d\n", j);
return 0;
}
A. 4 B. 7
C. 6 D. 17
5. In mathematics and computer programming, which is the correct order of mathematical operators ?
A. Addition, Subtraction, Multiplication, Division
B. Division, Multiplication, Addition, Subtraction
C. Multiplication, Addition, Division, Subtraction
D. Addition, Division, Modulus, Subtraction
3.MSQ- 5X1
1. Choose a right statement.
int a = 5/2;
int b = 5.0/2;
int c = 5 / 2.0;
int d = 5.0/2.0;
A) a = 2, b = 2 B) b = 2, d = 2.0
C) b = 2, c = 2 D) b = 2.5, d = 2.5
2. Choose a correct C Statement using IF Conditional Statement.
A)
if( condition ) C)
{ if( condition1 )
//statements; {
} //statements;
B) }
else if( condition2)
if( condition )
{ {
//statements; //statements;
} }
else else
{ {
//statements; //statements;
} }
D) if( condition )
{
//statements;
};
3. What is the output of C Program.?
int main()
{
int a=9;
if(a=8)
{
printf("Kangaroo\n");
}
printf("Eggs\n");
return 0;
}
A) No output B) Kangaroo
C) Eggs D) Compiler error
Ans –
4. 4. Which of the following are unary operators in C?
1. !
2. sizeof
3. ~
4. &&
A. 1 B. 2
C. 3 D. 4
5. What will be the output of the program?
#include<stdio.h>
int main()
{
int i=2;
printf("%d, %d\n", ++i, ++i);
return 0;
}
A. 3, 3 B. 4, 3
C. 4, 4 D. 3, 4
4.Matching – 5X1
ANS-
Group-I Group-II
(i) ---
(i) int a = 3.6 + 4.5; (i) !, &&, ||
(ii) printf() and scanf() functions (ii) (+, -) < (*, / and %)
(iii) Logical operators (iii) ?: (ii) ---
(iv) In C language, which Operator (iv) a = 8.1
group has more priority between (v) !, &&, ||, !=
(iii) ---
(*, / and %) and (+, -) groups.? (vi) a = 8
(v) ternary operator (vii) (+, -) > (*, / and %)
(viii) take input from the (iv) ---
user.
(v) ---