CC-COMPROG11 - Computer Programming 1 Midterm Examination

CC-COMPROG11 - Computer Programming 1 Midterm Examination

University

54 Qs

quiz-placeholder

Similar activities

Web Application and Browser Security Questions

Web Application and Browser Security Questions

University

50 Qs

OCC Cybersecurity Welcome Test

OCC Cybersecurity Welcome Test

University

50 Qs

IT 1 (2nd sem prelim) - Python

IT 1 (2nd sem prelim) - Python

University

50 Qs

Repaso Programación II

Repaso Programación II

University

50 Qs

соңғы сессия 5 бзв

соңғы сессия 5 бзв

University

50 Qs

соңғы сессия 6 бзв

соңғы сессия 6 бзв

University

50 Qs

PSAT TIK VII A 2025

PSAT TIK VII A 2025

7th Grade - University

50 Qs

DSA Quiz # 1

DSA Quiz # 1

University

50 Qs

CC-COMPROG11 - Computer Programming 1 Midterm Examination

CC-COMPROG11 - Computer Programming 1 Midterm Examination

Assessment

Quiz

Information Technology (IT)

University

Practice Problem

Medium

Created by

Zemmary Batucan

Used 1+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

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

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?