
C_PROG

Quiz
•
English
•
University
•
Medium
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
Similar Resources on Wayground
10 questions
CV writing

Quiz
•
University
5 questions
C String

Quiz
•
University
10 questions
Critical Reading and Writing

Quiz
•
University
10 questions
Creating tables in HTML

Quiz
•
University
11 questions
CSD-Q9

Quiz
•
9th Grade - University
10 questions
In-text citation

Quiz
•
University
10 questions
Diesel Power Plants

Quiz
•
University
10 questions
Summary writing

Quiz
•
University
Popular Resources on Wayground
55 questions
CHS Student Handbook 25-26

Quiz
•
9th Grade
18 questions
Writing Launch Day 1

Lesson
•
3rd Grade
10 questions
Chaffey

Quiz
•
9th - 12th Grade
15 questions
PRIDE

Quiz
•
6th - 8th Grade
40 questions
Algebra Review Topics

Quiz
•
9th - 12th Grade
22 questions
6-8 Digital Citizenship Review

Quiz
•
6th - 8th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade