C Programming Lab

C Programming Lab

Professional Development

15 Qs

quiz-placeholder

Similar activities

Apache Spark

Apache Spark

Professional Development

10 Qs

Sains Komputer Tingkatan 4 - 3.1.1 Mengkaji keperluan intera

Sains Komputer Tingkatan 4 - 3.1.1 Mengkaji keperluan intera

1st Grade - Professional Development

10 Qs

Power Apps Introduction

Power Apps Introduction

Professional Development

10 Qs

JS

JS

Professional Development

15 Qs

NM-BIG DATA Course

NM-BIG DATA Course

Professional Development

20 Qs

DL Refresher

DL Refresher

KG - Professional Development

10 Qs

Topic Quiz-1 : Python Basics

Topic Quiz-1 : Python Basics

Professional Development

10 Qs

Internet et le Web

Internet et le Web

Professional Development

15 Qs

C Programming Lab

C Programming Lab

Assessment

Quiz

Computers

Professional Development

Medium

Created by

karthick k

Used 1+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the scope of an external variable?

Whole source file in which it is defined

From the point of declaration to the end of the file in which it is defined

Any source file in a program

From the point of declaration to the end of the file being compiled

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the output of this C code?

#include <stdio.h>

void main()

{

int x = 97;

int y = sizeof(x++);

printf("x is %d", x);

}

x is 97

x is 98

x is 99

Run time error

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the output of the below c code?

#include <stdio.h>

void main()

{

char *s = "hello";

char *p = s;

printf("%p\t%p", p, s);

}

Different address is printed

Same address is printed

Run time error

Nothing

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the output of this C code?

#include <stdio.h>

struct student

{

char a[5];

};

void main()

{

struct student s[] = {"hi", "hey"};

printf("%c", s[0].a[1]);

}

h

i

e

y

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the output of this C code?

#include <stdio.h>

#define foo(m, n) m * n = 10

int main()

{

printf("in main\n");

}

In main

Compilation error as lvalue is required for the expression m*n=10

Preprocessor error as lvalue is required for the expression m*n=10

None of the mentioned

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the output of this C code?

void main ()

{

int a=2;

if(a==2)

{

a=~a+2<<1;

printf("%d",a);

}

else

{

a=~a;

}

}

6

-2

0

None of above

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Predict the output of the following C snippets

int main()

{

int main = 56;

printf("%d", main);

return 0;

}

Compiler Error

Depends on the compiler

56

none of above

Create a free account and access millions of resources

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

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?