C_PROG

C_PROG

University

8 Qs

quiz-placeholder

Similar activities

Unit 2 quiz - Tech Eng II (décima)

Unit 2 quiz - Tech Eng II (décima)

University

6 Qs

CIS 1300

CIS 1300

University

5 Qs

ACADEMIC ALTERNATIVES TO PHRASAL VERBS

ACADEMIC ALTERNATIVES TO PHRASAL VERBS

University

10 Qs

Searching for online sources

Searching for online sources

University

13 Qs

Creating tables in HTML

Creating tables in HTML

University

10 Qs

CSD-Q9

CSD-Q9

9th Grade - University

11 Qs

Diesel Power Plants

Diesel Power Plants

University

10 Qs

C-Programming

C-Programming

11th Grade - University

10 Qs

C_PROG

C_PROG

Assessment

Quiz

English

University

Medium

Created by

Harshitha P

Used 1+ times

FREE Resource

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

8.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

#include <stdio.h>

#include <string.h>

 

int main()

{

    char str1[20] = "Hello";

    char str2[4];

 

    strcpy(str2, str1);

 

    printf("str1: %s\n", str1);

    printf("str2: %s\n", str2);

 

    return 0;

}

ERROR

HELLO

HELLO,HELLO

4

Discover more resources for English