[ 100% Correct ] C-Test – Spoken Tutorial Quiz Answers

C-Test – Spoken Tutorial Quiz Answers – All the Answers Provided on this page are Correct if you think there is any mistake, Please comment, we will update it soon.

Q1. If originally x=0, y=0, and z=1, what is the value of x, y and z after executing the following code?

if(x)

{

x–;y=x+2;

}
else x++;

Select one:

(A) x=0, y=1, z=1
(B) x=0, y=0, z=0
(C) x=1, y=1, z=1
(D) x=1, y=0, z=1

Ans:- a

Q2. What is the purpose of namespace?

Select one:

(A) To group functions
(B) To avoid name collisions+
(C) To execute a program
(D) To create an object

Ans:- b

Q3. What will be the output of the following program?

#include<stdio.h>
 int main()
 {
     int k, num = 30;
     k = (num < 10) ? 100 : 200;
     printf("%d", num);
     return 0;
 }

Select one:

(A) 200

(B) 30

(C) 100

(D) 500

Ans:- (B) 30

Drupal Test – Spoken Tutorial Quiz Answers

Q4. Name the region of code within which a variable is accessible.

Select one:

(A) Header

(B) None of these

(C) Scope of a variable

(D) Functions

Ans:- (C) Scope of a variable

Q5. What will be the output of the following program?

#include<stdio.h>
 int main()
 {
     int x = 3;
     float y = 3.0;
     if(x == y)
         printf("x and y are equal");
     else
         printf("x and y are not equal");
     return 0;
 }

Select one:

(A) Random output

(B) x and y are equal

(C) Error

(D) x and y are not equal

Ans:- (B) x and y are equal

Q6. Which of the following statements should NOT be used to increase the value of c by 1?

Select one:

(A) c + 1 => c;

(B) c = c + 1;

(C) c += 1

(D) c++;

Ans:- (A) c + 1 => c;

Q7. What is the variable called that is declared outside all the functions?

Select one:

(A) None of these

(B) Global variable

(C) Local variable

(D) Formal variable

Ans:- (B) Global variable

Q8. Which of the following functions should not use a return statement?

Select one:

(A) void

(B) global

(C) non-void

(D) main

Ans:- (A) void

Drupal Test – Spoken Tutorial Quiz Answers

Q9. What will be the output of the following C program?

#include<stdio.h>
#include<string.h>
 int main()
 {
     static char str1[] = "dills";
     static char str2[20];
     static char str3[] = "Daffo";
     int i;
     i = strcmp(strcat(str3, strcpy(str2, str1)), "Daffodills");
     printf("%d", i);
     return 0;
 }

Select one:

(A) 0

(B) 4

(C) 2

(D) 1

Ans:- (A) 0

Q10. What will be output of the following c program? 

#include<stdio.h>
int xyz=10;
int main(){
    int xyz=20;
    printf("%d",xyz);
    return 0;
}

Select one:

(A) 20

(B) Compilation Error

(B) None of these

(D) 30

Ans:- (A) 20

C-Test – Spoken Tutorial Quiz Answers – All the Answers Provided on this page are Correct if you think there is any mistake, Please comment, we will update it soon.

Q11. What will be the output of the following program?

#include<stdio.h>
 int main()
 {
     int x, y, z;
     x=y=z=1;
     z = ++x;
     z = ++y;
     z = ++z;
     printf("x=%d, y=%d, z=%d", x, y, z);
     return 0;
 }

Select one:

(A) x=2, y=2, z=1

(B) x=2, y=2, z=2

(C) x=1, y=2, z=1

(D) x=2, y=2, z=3

Ans:- (D) x=2, y=2, z=3

Q12. What will be the output of the following C program?

#include<stdio.h>
int main()
 {
     int arr[1]={10};
     printf("%d", arr[0]);
     return 0;
 }

Select one:

(A) 1

(B) 0

(C) 10

(D) 6

Ans:- (C) 10

Q13. If return type for a function is NOT specified, then what is the default return type?

Select one:

(A) character

(B) int

(C) double

(D) float

Ans:- (B) int

Drupal Test – Spoken Tutorial Quiz Answers

Q14. What will be the output of the following C program?

#include<stdio.h>
 int sumdig(int);
 int main()
 {
     int a, b;
     a = sumdig(123);
     b = sumdig(123);
     printf("%d, %d", a, b);
     return 0;
 }
 int sumdig(int n)
 {
     int s, d;
     if(n!=0)
     {
         d = n%10;
         n = n/10;
         s = d+sumdig(n);
     }
     else
         return 0;
     return s;
 }

Select one:

(A) 6, 6

(B) 12, 12

(C) 4, 4

(D) 3, 3

Ans:- (A) 6, 6

Q15. What will be the output of the following C program?

#include<stdio.h>
 void fun(int*, int*);
 int main()
 {
     int i=5, j=2;
     fun(&i, &j);
     printf("%d, %d", i, j);
     return 0;
 }
 void fun(int *i, int *j)
 {
     *i = *i**i;
     *j = *j**j;
 }

Select one:

(A) 2, 5

(B) 10, 4

(C) 25, 4

(D) 5, 2

Ans:- (C) 25, 4

Q16. What will be the output when you execute the following C code? 

#include<stdio.h>
int main()
{
    const int *p;
    int a=10;
    p=&a;
    printf("%d",*p);
    return 0;
}

Select one:

(A) 10

(B) 1

(C) 0

(D) 11

(E) Error: Cannot modify const object

Ans:- (A) 10

Q17. What is the statement terminator in C?

Select one:

(A) &

(B) /

(C) *

(D) ;

Ans:- (D) ;

Q18. What will be output when you execute the following C code? 

#include<stdio.h>
void main(){
    int a=5,b=10,c=1;
    if(a+b>c+b){
         printf("cquestionbank");
    }
    else{
         break;
    }
}

Select one:

(A) cquestionbank

(B) Compilation error

(C) It will print nothing

(D) None of these

(E) Run time error

Ans:- (B) Compilation error

Drupal Test – Spoken Tutorial Quiz Answers

Q19. What will be the output of the following program?

#include<stdio.h>
 int main()
 {
     int i=0;
     for(; i<=5; i++);
         printf("%d", i);
     return 0;
 }

Select one:

(A) 0, 1, 2, 3, 4, 5

(B) 5

(C) 1, 2, 3, 4

(D) 6

Ans:- (D) 6

Q20. Point out the error line in the following program.

1.   #include<stdio.h>
2.   int main()
3.   {
4.       int i=1;
5.       for(;;)
6.          {
7.           printf("%d\n", i++);
8.           if(i>10)
9.           break;
10.        }
11.  return 0;
12.  }

Select one:

(A) Line number 8
(B) Line number 5
(C) None of these.
(D) Line number 4

Ans:- (C) None of these.

Q21. Select the missing code lines from the dropdown provided.

The C code given below should print the reverse of a number entered by the user.
But, line numbers 9 and 10 are missing.

1. #include <stdio.h>
2. int main()
3. {
4.   int num, reverse=0, rem;
5.   printf("Enter an integer:");
6.   scanf("%d", &num);
7.   while(num>0)
8.   {
9.        ---------------Missing code -------------------
10.      ---------------Missing code -------------------
11.      num/=10;
12.   }
13.   printf("Reverse is = %d",reverse);
14.   return 0;
15. }

Ans:-

Line 9
Line 10
rem=num%10;
reverse=reverse*10+rem;

Q22. What will be the output of the program? Type the answer with the correct case.

#include<stdio.h>
 int main()
 {
   char str[6] = "India ";
   printf("%s",str);  
   return 0;
 }

Answer: India

Q23. What will be the output of the program?  Write the answer in digits not alphabets.

#include<stdio.h>
int main()
{
    int a=250;
    printf("%1d",a);
    return 0;
}

Answer: 250

C-Test – Spoken Tutorial Quiz Answers – All the Answers Provided on this page are Correct if you think there is any mistake, Please comment, we will update it soon.

Q24. Which of the following cannot be checked in a switch-case statement?

Select one:

(A) Float

(B) Character

(C) None of these

(D) Integer

Ans:- (A) Float

Q25. Which operator is used by a structure to access the structure element?

Select one:

(A) Dollar ($)

(B) Ampersand (&)

(C) Dot (.)

(D) Asterisk (*)

Ans:- (C) Dot (.)

Q26. Which of the following is a derived datatype?

Select one:

(A) char

(B) float

(C) double

(D) array

Ans:- (D) array

Q27. How many cases a switch statement can have?

Select one:

(A) Any number

(B) 1

(C) 256

(D) 10

Ans:- (C) 256

Q28. If x=10 and sum=0, what is the value of sum after we execute sum=++x?

Select one:

(A) 0

(B) 11

(C) 9

(D) 10

Ans:- (D) 10

Q29. Observe the following function declaration and choose the best answer: int divide (int a, int b = 2)

Select one:

(A) Variable b is global and will have value 2

(B) Variable b is of integer type and will always have value 2

(C) Variable b will have value 2, unless specified while calling the function

(D) Variable a and b are of type int and the initial value of both the variables is 2

Ans:- (C) Variable b will have value 2, unless specified while calling the function

Q30. We declare a function with _________ if it does not have any return type.

Select one

(A) long

(B) int

(C) double

(D) void

Ans:- (D) void

Q31. What is the data-type of ‘9’?

Select one:

(A) double

(B) char

(C) int

(D) float

Ans:-

Q32. Which of the following statement(s) is/are correct about an array?

Tick all correct answer(s). No partial marks and no negative marks.

Select one or more:

(A) The declaration num[SIZE] is allowed if SIZE is a macro.

(B) It is necessary to initialize the array at the time of declaration.

(C) The expression num[1] designates the very first element in the array.

(D) The array int num[26]; can store 26 elements.

Ans:- (A) , (D)

Q33. Which of the following operation(s) is/are correct?

Tick all correct answer(s). No partial marks and no negative marks.

Select one or more

(A) short int j = 255, j =j:

(B) int i = 35, i=1%5,

(C) float a 3.14, a = a %3,

(D) long int k = 365L; k = k

Ans:- (A), (B) & (D)

C-Test – Spoken Tutorial Quiz Answers – All the Answers Provided on this page are Correct if you think there is any mistake, Please comment, we will update it soon.

NOTE:- All Answers Will be Uploaded Shortly And It Will Be Notified On Telegram, JOIN NOW

Drupal Test – Spoken Tutorial Quiz Answers

HTML Test – Spoken Tutorial Quiz Answers

Python Test – Spoken Tutorial Quiz Answers

1 thought on “[ 100% Correct ] C-Test – Spoken Tutorial Quiz Answers”

Leave a Comment