Question 21
EasyWhat is the output of this program?
#include <stdio.h>
#
{
s[] = ;
(, ()(s));
;
}
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Programming Languages
What is the output of this program?
#include <stdio.h>
#
{
s[] = ;
(, ()(s));
;
}
hello
5
4
6
Sign up free to see the answer and a step-by-step explanation.
What is the output of this program?
#include <stdio.h>
int main() {
printf("%d", 5 > 3 && 2 > 4);
return 0;
}
true
0
Sign up free to see the answer and a step-by-step explanation.
What is the output of this program?
#include <stdio.h>
int main() {
int x = 10;
x += 5;
x *= 2;
printf("%d", x);
return 0;
}
25
15
Sign up free to see the answer and a step-by-step explanation.
Which C function reads formatted input from the keyboard?
scanf()
input()
printf()
gets_line()
Sign up free to see the answer and a step-by-step explanation.
Which printf format specifier prints a single character?
%c
%s
%f
%d
Sign up free to see the answer and a step-by-step explanation.
What does a break statement do inside a loop in C?
Ends the program
Skips to the next iteration
Ends the loop immediately
Restarts the loop
Sign up free to see the answer and a step-by-step explanation.
Which C keyword makes a local variable keep its value between calls to a function?
auto
static
const
extern
Sign up free to see the answer and a step-by-step explanation.
What is the output of this program?
#include <stdio.h>
void tick(void) {
static int count = 0;
count++;
printf("%d ", count);
}
int main(void) {
tick();
tick();
tick();
return 0;
}
0 1 2
3 3 3
Sign up free to see the answer and a step-by-step explanation.
What is the output of this program?
#include <stdio.h>
int main(void) {
int x = 2;
switch (x) {
case 1: printf("One ");
case 2: printf("Two ");
case 3: printf("Three ");
default: printf("Default");
}
return 0;
}
Two Three Default
Default
Sign up free to see the answer and a step-by-step explanation.
What is the output of this program?
#include <stdio.h>
#include <string.h>
int main(void) {
char s[] = "hello";
printf("%zu", strlen(s));
return 0;
}
5
4
Sign up free to see the answer and a step-by-step explanation.
false
1
20
30
1 2 3
1 1 1
Two
Two Three
6
Error