pointers B

pointers B

Professional Development

16 Qs

quiz-placeholder

Similar activities

Matrix

Matrix

Professional Development

15 Qs

SASI -1st year -DAY4-FN (21.12.23)

SASI -1st year -DAY4-FN (21.12.23)

Professional Development

15 Qs

VCE-GAMMA-21.11.2023-AN

VCE-GAMMA-21.11.2023-AN

Professional Development

15 Qs

SASI -BATCH 3-DAY6-FN(25.11.23)

SASI -BATCH 3-DAY6-FN(25.11.23)

Professional Development

15 Qs

SASI -BATCH 3-DAY5-AN(24.11.23)

SASI -BATCH 3-DAY5-AN(24.11.23)

Professional Development

15 Qs

SASI -1st year -DAY4-AN (21.12.23)

SASI -1st year -DAY4-AN (21.12.23)

Professional Development

15 Qs

SASI -BATCH 3-DAY2-FN

SASI -BATCH 3-DAY2-FN

Professional Development

15 Qs

13 dec 2023 SRMIST  TRC MCA    FN

13 dec 2023 SRMIST TRC MCA FN

Professional Development

15 Qs

pointers B

pointers B

Assessment

Quiz

English

Professional Development

Hard

Created by

CCC info@ccc.training

FREE Resource

16 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

#include<stdio.h> int main(){ int a, b, c; char *p = 0; int *q = 0; double *r = 0; a = (int)(p + 1); b = (int)(q + 1); c = (int)(r + 1); printf("%d %d %d",a, b, c); return 0; }
Runtime error
0 0 0
Compilation error
1 4 8

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

#include<stdio.h> int main() { const int a = 5; const int *ptr; ptr = &a; *ptr = 10; printf("%d\n", a); return 0; }
Compilation error
Garbage Value
Address
5

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

#include<stdio.h> int main() { printf("%d", sizeof(void *)); return 0; }
1
compilation error
Runtime error
4

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

#include<stdio.h> int main() { int a = 10, b = 6; int *ptr; ptr = &b; printf(" %d ", a **ptr); return 0; }
Pointer type error
Run time error
Compilation error
60

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

#include<stdio.h> int main(){ char array[5] = "Knot", *ptr, i, *ptr1; ptr = &array[1]; ptr1 = ptr + 3; *ptr1 = 101; for(i = 0; i < 4;i++) printf("%c", *ptr++); return 0; }
not
Knot
note
garbage value

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

#include<stdio.h> int main(){ int i = 5; void *vptr; vptr = &i; printf("\nValue of iptr = %d ", *vptr); return 0; }
5
garbage address
garbage value
Compile time error

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

#include<stdio.h> int main() { int num = 10; // assume the address location is 2293436 printf("num = %d address = %u ",num, &num); num++; printf("\tnum = %d address = %u",num, &num); return 0; }
Compilation error
num = 10 address = 2293436 num = 11 address = 2293438
num = 10 address = 2293436 num = 11 address = 2293440
num = 10 address = 2293436 num = 11 address = 2293436

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?