Inputs and Outputs Operations

Inputs and Outputs Operations Quiz

1
Created on By wefru

Input and Output Operations

TEST YOUR BROAD SKILLS

1 / 10

Q.61 What will happen if in a C program you assign a value to an array element whose subscript exceeds the size of array?

2 / 10

Q.62 What would be the output of the following program? #include

main()

{

char str[]="S\065AB"; printf("\n d", sizeof(str));

}

3 / 10

Q.63 What will be the value of `a` after the following code is executed #define square(x) x*x

a = square(2+3)

4 / 10

Q.64 #include void func()

{

int x =  0; static int y = 0; x++; y++;

printf( "d -- d\n", x, y );

}

int main()

{

func();

func(); return 0;

}

What will the code above print when it is executed?

5 / 10

Q.65 long factorial (long x)

{

????

return x * factorial(x - 1);

}

With what do you replace the ???? to make the function shown above return the correct answer?

6 / 10

Q.66 int y[4] = {6, 7, 8, 9};

int *ptr = y + 2; printf("d\n", ptr[ 1 ] );

What is printed when the sample code above is executed?

7 / 10

Q.67 int i = 4; switch (i)

{

default: ; case 3:

i += 5;

if ( i == 8)

{ i++;

if (i == 9) break; i *= 2;

}

i -= 4;

break;

 

case 8:

i += 5;

break;

}

printf("i = d\n", i);

What will the output of the sample code above be?

8 / 10

Q.68 What will be output if you will compile and execute the following c code?

void main()

 

{

if(printf("cquestionbank")) printf("I know c");

else

printf("I know c++");

}

9 / 10

Q.69 What will be output if you will compile and execute the following c code?

#define call(x) #x

void

main()

{

printf(" s",call(c/c++));

}

10 / 10

Q.70 What will be output if you will compile and execute the following c code? #define message "union is\

power of c" void main()

{

clrscr();     printf(" s",message); getch();

}

Your score is

The average score is 30%

0%

Leave a Reply

Your email address will not be published.