
C Programming Quiz 2
Quiz
•
Computers
•
University
•
Practice Problem
•
Hard

Ngai Lee
Used 40+ times
FREE Resource
Enhance your content in a minute
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following C statements is wrong?
void main( )
{
}
void main(void)
{
}
int main( )
{
return (0);
}
int main ( int argc, char *argv[])
{
return 0;
}
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which should be the printf statement of the following program:
void main()
{
int age = 10;
printf...
}
printf("I am %d years old.\n");
printf("I am %f years old.\n", age);
printf("I am %s years old.\n");
printf("I am %d years old.\n", age);
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following statements is/are correct?
a. char middle_name='c';
scanf("%c", middle_name);
b. char middle_name="c";
scanf("%c", middle_name);
c. char middle_name='c';
scanf("%s",middle_name);
d. char middle_name='c';
scanf("%c", &middle_name);
A is correct.
B is correct.
C is correct.
D is correct.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which printf statement will produce the following output:
C:\document\storage\c'drive "storage" =142.134GB
printf("C:\document\\storage\c'drive "storage" = 142.134GB");
printf("C:\\document\\storage\\c'drive "storage" = 142.134GB");
printf("C:\\document\\storage\\c'drive \"storage\"= 142.134GB");
printf("C:\\document\\storage\\c\'drive \"storage\" = 142.134GB");
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Predict the output.
#include <stdio.h>
int main( ) {
int x=11;
x=printf("%d",x++);
printf("%d",x);
return 0;
}
11
111
112
12
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Check the following code segment and try to predict what's going to happen?
#include <stdio.h>
int main(){
int x=++2;
printf("%d",x);
return 0;
}
3 will be printed on compilation and execution.
2 will be printed on compilation and execution.
compilation error - "Ivalue required".
runtime error.
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following program:
#include <stdio.h>
void main() n{
char country[20];
printf("Enter the name of your country:\n");
scanf("%s",string1);
printf("\n\nYou have just entered: %s",string1);
}
if the user key in 'Republic of China' as the name of the country?
You have just entered: Republic of China
You have just entered: China
You have just entered: Republic
You have just entered: Republic Poly
Access all questions and much more by creating a free account
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
Already have an account?
Similar Resources on Wayground
10 questions
PYTHON BASICS PART 1
Quiz
•
University
10 questions
CS100||MsWord
Quiz
•
University
15 questions
[CEH4H3] Sistem Tertanam Ganjil 1819 Kuis Online 2
Quiz
•
University
12 questions
IP-Com3 - Clase 2
Quiz
•
University
15 questions
Chapter 8 - Memory Management Strategies
Quiz
•
University
15 questions
Revisão - Unidade I - Teoria da Computação
Quiz
•
University
10 questions
Quiz - CSE
Quiz
•
University
15 questions
GK Quiz
Quiz
•
University
Popular Resources on Wayground
8 questions
2 Step Word Problems
Quiz
•
KG - University
20 questions
Comparing Fractions
Quiz
•
4th Grade
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
Latin Bases claus(clois,clos, clud, clus) and ped
Quiz
•
6th - 8th Grade
22 questions
fractions
Quiz
•
3rd Grade
7 questions
The Story of Books
Quiz
•
6th - 8th Grade
Discover more resources for Computers
8 questions
2 Step Word Problems
Quiz
•
KG - University
7 questions
Comparing Fractions
Interactive video
•
1st Grade - University
7 questions
Force and Motion
Interactive video
•
4th Grade - University
10 questions
14.2 Independent/Dependent Variables
Quiz
•
KG - University
18 questions
Great Lakes States
Quiz
•
KG - University
7 questions
DNA, Chromosomes, Genes, and Traits: An Intro to Heredity
Interactive video
•
11th Grade - University
7 questions
Reflexive Verbs in Spanish
Lesson
•
9th Grade - University
7 questions
Narrative Writing 1
Interactive video
•
4th Grade - University
