Search Header Logo

C Programming Quiz-1

Authored by Baburaj KV

Computers

University

Used 5+ times

C Programming Quiz-1
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What will be the output of following program ?


#include <stdio.h>

void main() {

printf("Hello "World"\n");

}

Hello “World”

Hello

error

none of above

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What will be the output of following program ?

#include <stdio.h>

void main() {

printf("Hello\rWorld\n");

}

HelloWorld

Hello World

Hello

World

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What will be output of the following program ?


#include <stdio.h>

void main() {

int i=1, j=2;

printf("%d\t%d\t%d\n", (++i+j++), i, j);

}

5 2 2

4 2 2

4 2 3

syntax error

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What will be the output of the following program?

#include <stdio.h>

void main() {

if(1 || 0)

printf("true");

else

printf("false");

}

true

false

error

none of above

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Predict output of the following program


#include <stdio.h>

void main() {

int i, j;

for(i=1;i<=5;i++) {

for(j=1;j<=5;j++); {

if(i==j)

printf("%d\t%d\t", i, j);

}

}

}

1 1 2 2 3 3 4 4 5 5

6 6

no output

syntax error

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What will be the output of the following program?

#include <stdio.h>

void main() {

int i, n=5;

for(i=1; i<=n;i++) {

printf("%d", n/(n-i));

}

}

1 1 2 5

no output

infinite loop

error

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which of the following program generates sequence ‘1 2 3 4’ ?

#include <stdio.h>

void main() {

for(int i=1; i<=5;i++) {

if(i==5)

break;

printf("%d\t", i);

}

}

#include <stdio.h>

void main() {

for(int i=1; i<=5;i++); {

if(i==5)

continue;

printf("%d\t", i);

}

}

both a) and b)

none of above

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?