Search Header Logo
TECHCROMA 2K24 - Code Change Filteration Process.

TECHCROMA 2K24 - Code Change Filteration Process.

Assessment

Presentation

Computers

University

Practice Problem

Hard

Created by

Amburu Kumar

Used 148+ times

FREE Resource

0 Slides • 20 Questions

1

Multiple Choice

Write the output of the following program.

 

#include <stdio.h>

#define m 5+5

const int n = 5+5;

void main( )

{

int a = 0, b = 0;

a = m * m;

b = n * n;

printf("%d %d\n", a, b);

}

1

35 100

2

100 100

3

100 35

4

Compilation error

2

Multiple Choice

Write the output of the following program.

#include <stdio.h>

void f(int a[ ], int n)

{

int i;

for (i = 0; i < n - 1; ++i)

a[i] += i+1[a];

}

int main ( )

{

int a[5] = {1, 2, 4, 60, 80};

f(a, 4);

printf("%d", a[4] - 3[a]);

return 0;

}

1

Compilation error

2

20

3

-20

4

2

3

Multiple Choice

What will be the output from the following program?

main( )

{

int a=(int)malloc(sizeof(int));

*a= -41;

printf("%d",(*a)+++*a++);

}

1

a)70    

2

-90      

3

Runtime Error     

4

-81

4

Multiple Choice

What will be the output from the following program?

void main( )

{

int p=-40,q=-20;

p= ~-q<<~-p + q>>2;

printf("%d", p);

}

1

-42

2

b. 42

3

c. 24

4

d. -24

5

Multiple Choice

What will be the output from the following program?

#define N -300

void main( )

{

printf("N = %d\n",N);

#undef N

#ifdef N

printf("NECN")

#endif

}

1

Compilation error

2

N = -300

3

N = -300

    NECN

4

Runtime error

6

Multiple Choice

What will be the output from the following program?

void main( )

{

int a, p[10]={-1,-2,-3,-4,-5,-6,-7,-8,-9,-10};

a=(p+2)[4];

printf("%d",a);

}

1

Compilation error

2

Runtime error

3

Logical error

4

None of these

7

Multiple Choice

What will be the output from the following program?

void main( )

{

extern float abc;

abc=13.0;

printf("%d\n",sizeof(abc+10.3));

}

1

Compilation error

2

Runtime error

3

4

4

None

8

Multiple Choice

What will be the output from the following program?

#include<stdio.h>

void func(char**);

int main( )

{

            char *a[ ] = { "1", "2", "3", "4", "5", "6" };

            func(a);

            return 0;

}

void func(char **p)

{

            char *p1;

            p1 = (p += sizeof(float))[-3];

            printf("%s\n", p1);

}

1

1

2

3

3

4

4

None of these

9

Multiple Choice

What will be the output of the following program

void main( )

{

printf( );

}

1

Run-Time Error     

2

Compile-Time Error                                            

3

No Output

4

None of these

10

Multiple Choice

What will be the output of the following program :

 

void main( )

{

printf(NULL);

}

1

Run-Time Error     

2

Compile-Time Error                                            

3

No Output

4

None of these

11

Multiple Choice

What will be the output of the following program :

 

void main( )

{

printf("%%",7);

}

1

7                             

2

Compile-Time Error          

3

%                             

4

%%

12

Multiple Choice

What will be the output of the following program :

 

void main( )

{

printf("//",5);

}

1

5                             

2

Compile-Time Error          

3

/                              

4

//

13

Multiple Choice

What will be the output of the following program :

 

void main( )

{

printf("d%",8);

}

1

8           

2

Compile-Time Error                                               

3

d%            

4

None of these

14

Multiple Choice

What will be the output of the following program :

void main( )

{

printf("%d",printf("Hi!")+printf("Bye"));

}

1

ByeHi!6                 

2

Hi!Bye6                

3

Compile-Time Error                     

4

None of these

15

Multiple Choice

What will be the output of the following program :

void main( )

{

printf("%d",printf("Hi!")*printf("Bye"));

}

1

ByeHi!6                 

2

Hi!Bye9                

3

Hi!Bye                   

4

None of these

16

Multiple Choice

What will be the output of the following program :

 

void main( )

                          {

printf("%d",printf("")+printf(""));

}

1

0                

2

No Output  

3

Compile-Time Error                                                         

4

None of these

17

Multiple Choice

What will be the output of the following program :

 

void main( )

{

printf("Hi Friends"+3);

}

1

Hi Friends             

2

Friends                  

3

Hi Friends3           

4

None of these

18

Multiple Choice

What will be the output of the following program :

 

void main( )

{

printf("Work" "Hard");

}

1

Work                     

2

Hard                      

3

No Output

4

WorkHard

19

Multiple Choice

What will be the output of the following program :

 

void main( )

{

int val=5,num;

printf("%d",scanf("%d %d",&val,&num));

}

 

[NOTE : ASSUME 2 values are entered by the user are stored in the variables 'val' & 'num' respectively]

1

1

2

2

3

5

4

None of these

20

Multiple Choice

What will be the output of the following program :

 

void main( )

{

int val=5;

val=printf("C") + printf("Skills"); printf("%d",val);

}

1

Skills5                   

2

C1                          

3

Compile-Time Error

4

CSkills7

Write the output of the following program.

 

#include <stdio.h>

#define m 5+5

const int n = 5+5;

void main( )

{

int a = 0, b = 0;

a = m * m;

b = n * n;

printf("%d %d\n", a, b);

}

1

35 100

2

100 100

3

100 35

4

Compilation error

Show answer

Auto Play

Slide 1 / 20

MULTIPLE CHOICE