Search Header Logo

C LANGUAGE A

Authored by sathwik jilla

World Languages

University

Used 3+ times

C LANGUAGE A
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

How many times while loop conditions will execute if i is initialised to 0 in both cases

while(i<n)

i++;

-------

do

i++;

while(i<=n);

n,n

n,n+1

n+1,n

n+1,n+1

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What will be the output of the following C code?

#define HELLO(a) #a

main()

{

printf(HELLO(good morning));

}

good morning

goodmorning

Option 3

error

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What will be the size of the following C structure?

#include <stdio.h>

struct temp

{

int a[10];

char p;

};

5

11

41

44

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What will be the output of the following code?

#include<stdio.h>

int foo();

int main()

{

int i=foo();

}

foo()

{

printf("2 ");

return 2;

}

2

compile time error

Depends on the compiler

Depends on the standard

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What will be the output of the following code?

#include<stdio.h>

struct test

{

int i;

char j;

};

main()

{

printf("%d",sizeof(struct test));

}

Error

1

4

8

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What will be the output of the following code?

#include<stdio.h>

void main(){

int k;

for(k= -3;k<-5;k++)

printf("Hello");

}

Hello

infinite hello

Runtime error

Nothing

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What will be output of the following code?

#pragma(1)

struct test

{

int i;

char j;

};

main()

{

printf("%d",sizeof(struct test));

}

1

8

Error

4

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?