Search Header Logo

coding

Authored by samrudhi pawar

Computers

University

Used 1+ times

coding
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

30 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

#include <stdio.h>

int main() {

int a = 5;

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

return 0;

}

11

12

10

Undefined behavior

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

#include <stdio.h>

int main() {

printf("%c", 'A' + 3);

return 0;

}

A

B

C

D

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

#include <stdio.h>

int main() {

int a=10, b=30;

// swapping

// a = (initial_a - initial_b)

a = a - b;

// b = (initial_a - initial_b) + initial_b = initial_a

b = a + b;

// a = initial_a - (initial_a - initial_b) = initial_b

a = b - a;

// %.2lf displays numbers up to 2 decimal places

printf("After swapping, a = %d", a);

printf("After swapping, b = %d", b);

return 0;

}

a=30 ,b=10

After swapping, a = 30

after swapping, b=10

After swapping, a = 30After swapping, b = 10

swapping a=10,b=20

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

#include <stdio.h>

int main() {

char str[] = "CSE";

printf("%s", str+2);

return 0;

}

CSE

SE

E

CS

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

#include <stdio.h>

int main() {

printf("%d", sizeof('A'));

}

1

2

4

Compiler dependent

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

#include <stdio.h>

int main() {

int x = 0;

if(x = 5)

printf("Hello");

else

printf("Bye");

}

Hello

Bye

Compiler error

Nothing

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

#include <stdio.h>

int main() {

for(int i=0; i<5; i++);

printf("Done");

}

Done 5 times

Done once

Compile error

Done 4 times

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?

Discover more resources for Computers