Troubleshoot Round 1 Set 3

20 Questions | Attempts: 144
Share

SettingsSettingsSettings
Technical Quizzes & Trivia

Questions and Answers
  • 1. 
    What is the output of the following code? #include<stdio.h> main() {     int n,i;     n=f(6);     printf("%d",n); } f(int x) {     if(x==2)             return 2;     else     {         printf("+");         f(x-1);     } }  
    • A. 

      ++++2

    • B. 

      +++++

    • C. 

      +++++2

    • D. 

      2

  • 2. 
    Which is correct with respect to the size of the data types?
    • A. 

      Char > int > float

    • B. 

      Int > char > float

    • C. 

      Char < int < double

    • D. 

      Double > char > int

  • 3. 
    #include <stdio.h>     int main()     {         reverse(1);     }     void reverse(int i)     {         if (i > 5)             exit(0);         printf("%d\n", i);         return reverse(i++);     }
    • A. 

      Compile time error

    • B. 

      1 2 3 4

    • C. 

      1 2 3 4 5

    • D. 

      Stack Overflow

  • 4. 
    What is function srand(unsigned)?
    • A. 

      Sets the seed for rand

    • B. 

      Doesn’t exist

    • C. 

      Is an error

    • D. 

      None of the mentioned

  • 5. 
    #define FALSE -1 #define TRUE 1 #define NULL 0 main() {     if(NULL)          puts("NULL");     else if(FALSE)         puts("TRUE");     else         puts("FALSE"); }
    • A. 

      NULL

    • B. 

      TRUE

    • C. 

      FALSE

    • D. 

      1

  • 6. 
    Void main() {     int a,b;     a=3,1;     b=(5,4);     printf("%d",a+b); }
    • A. 

      Error

    • B. 

      6

    • C. 

      8

    • D. 

      7

  • 7. 
    Int main() { int a; int b=5; a=0 && --b; printf("%d%d",a,b); }
    • A. 

      0 5

    • B. 

      Compile Time Error

    • C. 

      Syntax Error

    • D. 

      0 4

  • 8. 
    Void Main() { int a=10; printf("%d", a); }
    • A. 

      Run Time Error

    • B. 

      Compilation Error

    • C. 

      10

    • D. 

      None Of The Above

  • 9. 
    Int main(void) {     while(".") {     printf("Quest"); } return 0; }
    • A. 

      Quest(Infinity Times)

    • B. 

      Error

    • C. 

      Segmentation Fault

    • D. 

      None Of The Above

  • 10. 
    Int main() {     char str[10]="Quest";     printf("%d,%d\n",strlen(str),sizeof(str));     return 0; }
    • A. 

      5,10

    • B. 

      5,8

    • C. 

      5,6

    • D. 

      Error

  • 11. 
    #include <stdio.h>     int main()     {         int x = 2, y = 0;         int z = y && (y |= 10);         printf("%d\n", z);         return 0;     }
    • A. 

      Undefined behaviour due to order of evaluation

    • B. 

      0

    • C. 

      1

    • D. 

      2

  • 12. 
    Main(int arg,char **argv) {    printf("Enter the character");    getchar();    sum(argv[1],argv[2]); } sum(num1,num2) int num1,num2; {     return num1+num2; }
    • A. 

      No Error

    • B. 

      Compile Error

    • C. 

      No Output

    • D. 

      Run Time Error

  • 13. 
    _______ occurs when a result is too large in magnitude to represent errors as a floating-point value of the required type.
    • A. 

      Underflow

    • B. 

      Overflow

    • C. 

      Signi?cance loss

    • D. 

      Domain

  • 14. 
    Which one do you like?#include <stdio.h>     int main()     {         int i = 0;         int j = i++ + i;         printf("%d\n", j);     }
    • A. 

      Compile time error

    • B. 

      0

    • C. 

      1

    • D. 

      2

  • 15. 
    Void test(struct number n) {     n.x=100; } struct number{ int x; }; int main() {     struct number num;     test(num);     printf("%d\n",num.x);         return 0; }
    • A. 

      10

    • B. 

      100

    • C. 

      No output

    • D. 

      Error

  • 16. 
    Int main() {     int x=5;     if(x>=10)       printf("Quest");     printf("CSE");     else  printf("2K19"); }
    • A. 

      No output

    • B. 

      Compilation Error

    • C. 

      QuestCSE

    • D. 

      2K19

  • 17. 
    In the absence of a exit condition in a recursive function, the following error is given __________
    • A. 

      Compile Time Error

    • B. 

      Run Time Error

    • C. 

      Logical Error

    • D. 

      No error

  • 18. 
    Examination of the program step by step is called ______________
    • A. 

      Tracing

    • B. 

      Stepping

    • C. 

      Controlling

    • D. 

      Testing

  • 19. 
    #include<stdio.h> int main() {     int fun={     printf("C for Loop");     };     int x=5;     for(x=0;x<=fun;x++)     {        printf("%x",x);     }      }
    • A. 

      0 1 2 3 4 5 6 7 8 9

    • B. 

      C for Loop0 1 2 3 4 5 6 7 8 9 a

    • C. 

      Compile Time Error

    • D. 

      0 1 2 3 4 5 6 7 8 9 a

  • 20. 
    #include<stdio.h> #define x 5+2 int main( ) {      int i;      i=x*x*x;      printf("%d",i);      return 0; }
    • A. 

      27

    • B. 

      343

    • C. 

      233

    • D. 

      Compiler Error

Back to Top Back to top
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.