C programming Quiz

C programming Quiz

1st Grade

12 Qs

quiz-placeholder

Similar activities

3-ตัวแปรและตัวดำเนินการทางคณิตศาสตร์

3-ตัวแปรและตัวดำเนินการทางคณิตศาสตร์

KG - 11th Grade

10 Qs

Cấu trúc chương trình Pascal

Cấu trúc chương trình Pascal

1st - 12th Grade

15 Qs

KIỂM TRA MIỆNG

KIỂM TRA MIỆNG

KG - 1st Grade

8 Qs

jQuery - elementy

jQuery - elementy

KG - 8th Grade

8 Qs

основи програмування

основи програмування

1st Grade

12 Qs

C++ podstawy

C++ podstawy

1st Grade

15 Qs

C# 11

C# 11

1st - 10th Grade

10 Qs

TECHFEST 2K21 (DEBUGGING)

TECHFEST 2K21 (DEBUGGING)

1st Grade

10 Qs

C programming Quiz

C programming Quiz

Assessment

Quiz

Computers

1st Grade

Medium

Created by

Sheetal Patil

Used 7+ times

FREE Resource

12 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Who is the father of C language?

Steve Jobs

James Gosling

Dennis Ritchie

Rasmus Lerdorf

Answer explanation

Dennis Ritchie

2.

MULTIPLE CHOICE QUESTION

1 min • 2 pts

Which of the following does not initialize ptr to null (assuming variable declaration of a as int a=0;)?

int *ptr = &a;

int *ptr = &a – &a;

int *ptr = a – a;

All of the mentioned

Answer explanation

int *ptr = &a;

3.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

What will be the output of the following C code?

#include <stdio.h>

int x = 0;

void main()

{

int *ptr = &x;

printf("%p\n", ptr);

x++;

printf("%p\n ", ptr);

}

Same address

Different address

Compile time error

Varies

4.

MULTIPLE CHOICE QUESTION

2 mins • 2 pts

What will be the output of the following C code?

#include <stdio.h>

void main()

{

int x = 0;

int *ptr = &x;

printf("%d\n", *ptr);

}

Address of x

Junk value

0

Run time error

5.

MULTIPLE CHOICE QUESTION

2 mins • 2 pts

#include <stdio.h>

int main()

{

char str[10] = "hello";

char *str1 = "world";

strncat(str, str1, 9);

printf("%s", str);

}

helloworld

Undefined behaviour

helloworl

hellowor

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Strcat() function adds null character

Only if there is space

Always

Depends on the standard

Depends on the compiler

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which keyword can be used for coming out of recursion?

break

return

exit

both break and return

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?