Professional Documents
Culture Documents
Question 1 What will be output when you execute the following C code?
Complete
#include<stdio.h>
Mark 1.00 out of
1.00 void main(){
int a=100;
Flag question if(a>100)
printf("M.S. Dhoni");
else if(a>20)
printf("M.E.K Hussey");
else if(a>30)
printf("A.B. de villiers");
}
Select one:
Compilation Error
M. S. Dhoni
M. E. K Hussey
A. B. de Villiers
Select one:
1
https://onlinetest.spoken-tutorial.org/mod/quiz/review.php?attempt=1415591&showall=1 1/14
7/14/2021 C-Test-24mcqs+8qs
0
10
6
Question 4 Which of the following statements should NOT be used to increase the value of c by 1?
Complete
Mark 1.00 out of Select one:
1.00 c += 1
Flag question
c = c + 1;
c + 1 => c;
c++;
Question 6 Which keyword is used to transfer control from a function back to the calling function?
Complete
https://onlinetest.spoken-tutorial.org/mod/quiz/review.php?attempt=1415591&showall=1 2/14
7/14/2021 C-Test-24mcqs+8qs
Mark 1.00 out of Select one:
1.00
goto
Flag question
switch
return
go back
Select one:
12, 12
6, 6
3, 3
4, 4
https://onlinetest.spoken-tutorial.org/mod/quiz/review.php?attempt=1415591&showall=1 3/14
7/14/2021 C-Test-24mcqs+8qs
Select one:
Error
4, 3, 2, 1, 0, -1
4, 3, 2, 1, 0, -1
5, 4, 3, 2, 1, 0
5, 4, 3, 2, 1, 0
5, 4, 3, 2, 1, 0
5, 4, 3, 2, 1, 0
5, 4, 3, 2, 1, 0
printf("%c", *a);
a++;
printf("%c", *a);
}
Select one:
BC
CD
AB
No output
https://onlinetest.spoken-tutorial.org/mod/quiz/review.php?attempt=1415591&showall=1 5/14
7/14/2021 C-Test-24mcqs+8qs
9
10
11
Select one:
eee
eel
hel
ell
https://onlinetest.spoken-tutorial.org/mod/quiz/review.php?attempt=1415591&showall=1 6/14
7/14/2021 C-Test-24mcqs+8qs
Select one:
01
111
0
012
https://onlinetest.spoken-tutorial.org/mod/quiz/review.php?attempt=1415591&showall=1 7/14
7/14/2021 C-Test-24mcqs+8qs
Select one:
0
India
None of these
Error
https://onlinetest.spoken-tutorial.org/mod/quiz/review.php?attempt=1415591&showall=1 8/14
7/14/2021 C-Test-24mcqs+8qs
Select one:
This is default.This is case 1
This is case 1
This is default.
This is case 3
Question 21 If x=10 and sum=0, what is the value of sum after we execute sum=++x?
Complete
Mark 0.00 out of Select one:
1.00 10
Flag question 9
11
0
Question 22 How many time(s) the statement(s) in the do-while loop will be executed, if the condition is false?
Complete
Mark 1.00 out of Select one:
1.00 0
Flag question 1
Infinite
2
Select one:
Line number 9
None of these.
Line number 4
Line number 7
Select one:
None of these.
Line number 5
Line number 4
Line number 6
Question 25 Which of the following expression(s) changes the value of x? Tick all correct answer(s). No partial marks and no negative marks.
Complete
Mark 0.00 out of Select one or more:
2.00
https://onlinetest.spoken-tutorial.org/mod/quiz/review.php?attempt=1415591&showall=1 10/14
7/14/2021 C-Test-24mcqs+8qs
Flag question x
x++
++x
--x
Question 26 Which of the following statement(s) is/are correct? Tick all correct answer(s). No partial marks and no negative marks.
Complete Constants
Mark 0.00 out of
2.00
Select one or more:
Flag question Are fixed values
Are declared using 'const' keyword
Do not change during the execution of the program
Question 27 Which of the following statement(s) is/are correct about an array? Tick all correct answer(s). No partial marks and no negative
Complete marks.
Mark 2.00 out of
2.00 Select one or more:
Flag question The declaration num[SIZE] is allowed if SIZE is a macro.
The array int num[26]; can store 26 elements.
The expression num[1] designates the very first element in the array.
It is necessary to initialize the array at the time of declaration.
Question 28 Select the missing code lines from the dropdown provided.
Complete The C code given below should check whether the number entered by the user is Negative, Positive or Zero.
Mark 0.00 out of But, line numbers 9 and 11 are missing.
2.00
8. printf("%d is negative.",num);
9. ---------------Missing code -------------------
10. printf("%d is positive.",num);
11. ---------------Missing code -------------------
12. printf("You entered zero.");
13. return 0;
14. }
Line 9 scanf("%d",&num);
Line 11
scanf("%d",&num);
Question 29 Select the missing code lines from the dropdown provided.
Complete The C code given below should find the square of a given number.
Mark 1.00 out of But, line numbers 4 and 6 are missing.
2.00
Flag question
1. #include<stdio.h>
2. int main()
3. {
4. ---------------Missing code -------------------
5. printf("Enter the number\n");
6. ---------------Missing code -------------------
7. printf("Square of %d is %d \n", num, num*num);
8. return 0;
9. }
Question 30 Select the missing code lines from the dropdown provided.
Complete
https://onlinetest.spoken-tutorial.org/mod/quiz/review.php?attempt=1415591&showall=1 12/14
7/14/2021 C-Test-24mcqs+8qs
Mark 2.00 out of The C code given below should print the sum of digits of a number entered by the user.
2.00
But, line numbers 6 and 10 are missing.
Flag question
1. #include<stdio.h>
2. int main()
3. {
4. int num, sum=0, rem;
5. printf("Enter a number\n");
6. ---------------Missing code -------------------
7. while(num>0)
8. {
9. rem = num%10;
10. ---------------Missing code -------------------
11. num = num/10;
12. }
13. printf("Sum is %d\n", sum);
14. return 0;
15. }
Line 10
sum = sum+rem;
Question 31 What will be the output of the program? Write the answer in digits not alphabets.
Complete #include<stdio.h>
Mark 2.00 out of int main()
2.00 {
Flag question
int a=2,b=6,c;
c = a%b;
printf("%d",c);
return 0;
}
Answer: 2
Question 32 What will be the output of the program? Write the answer in digits not alphabets.
Complete
https://onlinetest.spoken-tutorial.org/mod/quiz/review.php?attempt=1415591&showall=1 13/14
7/14/2021 C-Test-24mcqs+8qs
Mark 2.00 out of #include<stdio.h>
2.00
int main()
Flag question {
int a=6;
int b=-4;
int c=0;
if(b>a)
printf("%d",c);
printf("%d",(a-b));
return 0;
}
Answer: 10
https://onlinetest.spoken-tutorial.org/mod/quiz/review.php?attempt=1415591&showall=1 14/14