C

Master C Programming Quiz
Test your knowledge of C programming with our engaging quiz! This quiz consists of 10 carefully crafted questions that cover various aspects of the C language, ranging from basic syntax to advanced concepts.
Get ready to challenge yourself and improve your programming skills!
- Multiple choice questions
- Instant feedback on answers
- Perfect for programmers of all levels
1. Which of the following library function is not case-sensitive?
A) toupper()
B) tolower()
C) isdigit()
D) all of the mentioned
2. Comment on the output of this C code?
-
#include <stdio.h>
-
int main()
-
{
-
char *a = {"p", "r", "o", "g", "r", "a", "m"};
-
printf("%s", a);
-
}
A) Output will be program
B) Output will be p
C) No output
D) Compile-time error
3. The correct way to generate numbers between minimum and maximum(inclusive) is _________________
A) minimum + (rand() % (maximum – minimum));
B) minimum + (rand() % (maximum – minimum + 1));
C) minimum * (rand() % (maximum – minimum))
D) minimum – (rand() % (maximum+minimum));
4. What is the output of this C code?
-
#include <stdio.h>
-
int main()
-
{
-
int a[4] = {1, 2, 3, 4};
-
int b[4] = {1, 2, 3, 4};
-
int n = &b[3] - &a[2];
-
printf("%d\n", n);
-
}
A) -3
B) 5
C) 4
D) Compile time error
5. Advantage of a multi-dimension array over pointer array.
A) Pre-defined size.
B) Input can be taken from user.
C) Faster Access.
D) All of the mentioned
6. What is the output of this C code?
-
#include <stdio.h>
-
struct p
-
{
-
int x;
-
char y;
-
struct p *ptr;
-
};
-
int main()
-
{
-
struct p p = {1, 2, &p};
-
printf("%d\n", p.ptr->x);
-
return 0;
-
}
A) Compile time error
B) Undefined behaviour
C) 1
D) 2
7. What is the output of this C code?
-
#include <stdio.h>
-
#include <ctype.h>
-
int main()
-
{
-
if (isspace('n'))
-
printf("space\n");
-
else
-
printf("not space\n");
-
return 0;
-
}
A) Compile time error
B) space
C) not space
D) None of the mentioned
8. What is the output of this C code?
-
#include <stdio.h>
-
void main()
-
{
-
char *a[10] = {"hi", "hello", "how"};
-
int I = 0;
-
for (i = 0;i < 10; i++)
-
printf("%s", a[i]);
-
}
A) hi hello how Segmentation fault
B) hi hello how null
C) hey hello how Segmentation fault
D) hi hello how followed by 7 nulls
9. What is the output of this C code?
-
#include <stdio.h>
-
struct student
-
{
-
};
-
void main()
-
{
-
struct student s[2];
-
printf("%d", sizeof(s));
-
}
A) 2
B) 4
C) 8
D) 0
10. What happens when we use fprintf(stderr, “error: could not open filen”);
A) The diagnostic output is directly displayed in the output.
B) The diagnostic output is pipelined to the output file.
C) The line which caused error is compiled again.
D) The program is immediately aborted.
{"name":"C", "url":"https://www.quiz-maker.com/QPREVIEW","txt":"Test your knowledge of C programming with our engaging quiz! This quiz consists of 10 carefully crafted questions that cover various aspects of the C language, ranging from basic syntax to advanced concepts.Get ready to challenge yourself and improve your programming skills!Multiple choice questionsInstant feedback on answersPerfect for programmers of all levels","img":"https:/images/course1.png"}
More Quizzes
C - Program Quiz
HOWZIT will present prizes to the winners
740
C - Program Quiz | HOWZIT AI Messenger | Indian Aibot App
HOWZIT will present prizes to the winners
740
C
1050
C Test - 1 (07 June 2021)
10514
C++ Fundamentals Quiz
10515
Python Introduction/Algorithms Quiz
10519
Data Structure
10524
ALZHEIMERS ROUND 1
11612
The principles of software design by Ismaeel Jabar
10510
Object Oriented Programming
7427
Review on Self Test 1.6
520
OOPS Introduction
3225