Search Header Logo

C_PROG

Authored by Harshitha P

English

University

Used 1+ times

C_PROG
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

8 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

#include <stdio.h>

int main()

{

int* pc, c;

c = 5;

pc = &c;

c = 1;

printf("%d", c);

printf("%d", *pc);

return 0;

}

11

1

5

15

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

#include <stdio.h>

int main()

{

int myAge = 43;

int* ptr = &myAge;

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

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

return 0;

}

43

0x7ffe102fd7a4

0x7ffe102fd7a4

43

0x7ffe102fd7a4

43

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

#include <stdio.h>

int main()

{

int myNumbers[4] = {25, 50, 75, 100};

printf("%d", sizeof(myNumbers));

return 0;

}

4

8

16

12

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

#include <stdio.h>

int sum(int k);

int main() {

int n=10;

int result = sum(n);

printf("%d", result);

return 0;

}

int sum(int n) {

if (n > 0) {

return n + sum(n- 1);

} else {

return 0;

}

}

10

55

50

30

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

#include <stdio.h>

int main() {

int matrix[2][3] = { {1, 4, 2}, {3, 6, 8} };

printf("%d", matrix[0][2]);

return 0;

}

4

6

3

2

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

#include <stdio.h> #include <string.h> int main() { char a[20]="Program"; char b[20]={'P','r','o','g','r','a','m','\0'}; // using the %zu format specifier to print size_t printf("Length of string a = %zu \n",strlen(a)); printf("Length of string b = %zu \n",strlen(b)); return 0; }

7 ,7

7,8

8,7

8,8

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

#include <stdio.h>

#include <string.h>

int main() {

char first_str[] = "NMIT";

char second_str[] = "NMI"

int res = strcmp(first_str, second_str);

if (res==0)

printf("Strings are equal");

else

printf("Strings are unequal");

return 0;

}

Strings are equal

ERROR

Strings are unequal

1

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

Microsoft

Continue with Microsoft

or continue with

Facebook

Facebook

Apple

Apple

Others

Others

Already have an account?