Answer key set D
Answer key set D
CYCLE TEST – I
Academic Year: 2022-2023 (ODD Semester)
Answer: D
2 What is the output of the following code snippet? 1 2 1 1 2.5.2
#include <stdio.h>
int main()
{
float s; double a; char b;
printf("%d", sizeof(s)+sizeof(a)*sizeof(b));
return 0;
}
a) 14
b) 13
c) 12
d) Compilation Error
Answer: C
3 Choose the correct answer. 1 2 1 1 2.5.2
#include <stdio.h>
int main()
{
int value = 350;
int value = 892;
printf("SRMIST!%d",value);
return 0;
}
a) SRMIST!350
b) Redefinition of value
c) SRMIST!892
d) SRMIST! Followed by a junk value.
int main()
{
int x, y = 5, z = 5;
x = y == z;
printf("%d", x);
getchar();
return 0;
}
a) 0
b) 1
c) 5
d) Compile error
Answer: B
5 After working of the prefix and postfix operators, select 1 2 1 1 2.5.2
all the correct statements for the code given below:
Void main() {
int x, y, z, k;
Answer: A
b) Quiz
c) 2005
Answer: B
7. 1 2 1 1 2.5.2
C is a ___ language
a) High Level
b) Low Level
c) Middle Level
d) Machine Level
Answer: C
8. 1 2 1 1 2.5.2
The equality operator is represented by
a) :=
b) .EQ.
c) =
d) = =
Answer: D
9. 1 2 3 1 2.5.2
What will be the output of the expression 11 ^ 5?
a) 5
b) 6
c) 11
d) 13
Answer: D
10. 1 2 2 1 2.5.2
The operator + in a+=4 means
a) a=a+4
b) a+4=a
c) a=4
d) a=4+4
Answer: A
Answer:
13 Pick the correct one from the following declaration is not 1 2 2 2 2.6.3
supported by C language?
a) String str;
b) char *str;
c) float str = 3e2;
d) Both String str; & float str = 3e2;
Answer: A
14 Conclude the output of the following c program? 1 2 3 2 2.6.3
#include <stdio.h>
int main()
{
int a=5;
int b=10;
int c;
c=a+b;
printf("%i", c);
return 0;
}
(A) 5
(B) 10
(C) 15
(D) Compilation error
Answer: (C)
15 1 2 2 2 2.6.3
Rushanth is playing with a tennikoit ball (Circle) He knows the
radius of the ball. Help him to find the area and perimeter of the
ball using a C program.
Hint:
Perimeter of a circle = 2πr
Area of a circle = πr
Part C (1 * 5 = 5 Marks)
(OR)
17 Kumar had taken the loan amount Rs. 30000 before 3 1 2 3 5 2.6.3
years in the HDFC bank at 2.5% interest. He went to
bank for make the payment of his loan. Therefore,
could you help him to pay the correct amount by
writing a C program to find the simple interest of his
loan amount?
Solution:
#include <stdio.h>
void main() {
int months;
scanf("%d", &months);
BL 1
44%
BL 2
56%