
CC-COMPROG11 - Computer Programming 1 Midterm Examination
Quiz
•
Information Technology (IT)
•
University
•
Practice Problem
•
Medium
Zemmary Batucan
Used 1+ times
FREE Resource
Enhance your content in a minute
54 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Which function is safest to use for reading strings in C to prevent buffer overflow?
gets()
scanf("%s", str)
fgets()
getchar()
2.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What does the following code output if user inputs Hello?
char ch;
ch = getchar();
printf("%c", ch);
H
Hello
e
Error
3.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Which function is now deprecated in C because of its insecurity?
scanf()
fgets()
gets()
getchar()
4.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What will happen in this code?
char name[10];
scanf("%s", name);
If user enters: programming
Prints "programming" correctly
Causes buffer overflow
Prints only "progra"
Prints "prog"
5.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Which input method allows reading a string including spaces?
scanf("%s", str)
gets(str)
fgets(str, sizeof(str), stdin)
getchar()
6.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What does strcspn(str, "\n") return if
str = "Hello\nWorld"?
5
6
10
11
7.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Which placeholder is correct for reading a floating-point number with scanf()?
%f
%lf
%d
%c
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
50 questions
Java қазақша 1 - 50
Quiz
•
University
49 questions
Digital Citizenship and ICT Quiz
Quiz
•
8th Grade - University
50 questions
Java қазақша 201 - 250
Quiz
•
University
49 questions
Network Analysis Quiz
Quiz
•
University
50 questions
BSIT2102 PL Networking1 Tuando
Quiz
•
University
56 questions
тест4
Quiz
•
University
49 questions
Pre-FINAL EXAM
Quiz
•
University
50 questions
Midterm GEE-LIE
Quiz
•
University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
54 questions
Analyzing Line Graphs & Tables
Quiz
•
4th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
Discover more resources for Information Technology (IT)
7 questions
How James Brown Invented Funk
Interactive video
•
10th Grade - University
5 questions
Helping Build the Internet: Valerie Thomas | Great Minds
Interactive video
•
11th Grade - University
12 questions
IREAD Week 4 - Review
Quiz
•
3rd Grade - University
23 questions
Subject Verb Agreement
Quiz
•
9th Grade - University
7 questions
Renewable and Nonrenewable Resources
Interactive video
•
4th Grade - University
19 questions
Review2-TEACHER
Quiz
•
University
15 questions
Pre2_STUDENT
Quiz
•
University
20 questions
Ch. 7 Quadrilateral Quiz Review
Quiz
•
KG - University
