
c programming quiz 2
Quiz
•
Special Education
•
1st - 3rd Grade
•
Hard
Manish Bhardwaj
Used 11+ times
FREE Resource
30 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
#include <stdio.h>
int main()
{
int x = 2, y = 0;
int z = (y++) ? y == 1 && x : 0;
printf("%d\n", z);
return 0;
}
0
1
Undefined behaviour
Compile time error
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
#include <stdio.h>
int main()
{
int x = 1;
int y = x == 1 ? getchar(): 2;
printf("%d\n", y);
}
Compile time error
Whatever character getchar function returns
Ascii value of character getchar function returns
2
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
#include <stdio.h>
int main()
{
int a = 2; int b = 0;
int y = (b == 0) ? a :(a > b) ? (b = 1): a;
printf("%d\n", y);
}
Compile time error
1
2
Undefined behaviour
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following C code?
#include <stdio.h>
int main()
{
int y = 1, x = 0;
int l = (y++, x++) ? y : x;
printf("%d\n", l);
}
1
2
Compile time error
Undefined behaviour
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
#include <stdio.h>
void main()
{
int k = 8; int m = 7;
int z = k < m ? k++ : m++;
printf("%d", z);
}
7
8
Run time error
15
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
#include <stdio.h>
void main()
{
int k = 8; int m = 7;
int z = k < m ? k = m : m++;
printf("%d", z);
}
Run time error
7
8
Depends on compiler
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
#include <stdio.h>
void main()
{
1 < 2 ? return 1 : return 2;
}
returns 1
returns 2
Varies
Compile time error
Create a free account and access millions of resources
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?
Similar Resources on Wayground
Popular Resources on Wayground
10 questions
Honoring the Significance of Veterans Day
Interactive video
•
6th - 10th Grade
10 questions
Exploring Veterans Day: Facts and Celebrations for Kids
Interactive video
•
6th - 10th Grade
19 questions
Veterans Day
Quiz
•
5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
15 questions
Circuits, Light Energy, and Forces
Quiz
•
5th Grade
6 questions
FOREST Self-Discipline
Lesson
•
1st - 5th Grade
7 questions
Veteran's Day
Interactive video
•
3rd Grade
20 questions
Weekly Prefix check #2
Quiz
•
4th - 7th Grade
Discover more resources for Special Education
6 questions
FOREST Self-Discipline
Lesson
•
1st - 5th Grade
7 questions
Veteran's Day
Interactive video
•
3rd Grade
10 questions
Area
Quiz
•
3rd Grade
8 questions
Ancient China Quick Check
Quiz
•
3rd Grade
10 questions
Setting Quiz
Quiz
•
2nd - 5th Grade
13 questions
Veterans' Day
Quiz
•
1st - 3rd Grade
20 questions
Irregular Plural Nouns
Quiz
•
3rd Grade
17 questions
Multiplication facts
Quiz
•
3rd Grade
