C Programming Day-10

C Programming Day-10

University

10 Qs

quiz-placeholder

Similar activities

Exploring Python's Math Module

Exploring Python's Math Module

University

15 Qs

Understanding Linked Lists

Understanding Linked Lists

University

10 Qs

Chapter 1: Statements Introduction

Chapter 1: Statements Introduction

University

10 Qs

MWD Technology Quiz

MWD Technology Quiz

University

10 Qs

Project 1.2 Kite Tailing Test Review

Project 1.2 Kite Tailing Test Review

12th Grade - University

15 Qs

DS- Introduction to Python - Quiz

DS- Introduction to Python - Quiz

University

15 Qs

Exploring Python Strings and Methods

Exploring Python Strings and Methods

University

15 Qs

SD2 Prelim Activity 1

SD2 Prelim Activity 1

University

15 Qs

C Programming Day-10

C Programming Day-10

Assessment

Quiz

Engineering

University

Practice Problem

Medium

Created by

Vaishnavi K

Used 2+ times

FREE Resource

AI

Enhance your content in a minute

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

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

1. What is the correct function to calculate the square root of a number in C?

sqrt()

pow()

sqr()

root()

Answer explanation

Media Image

sqrt() returns the square root of a number. You must include math.h.

2.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

What does the function pow(2, 3) return?

5

6

7

8

Answer explanation

Media Image

pow(a, b) returns a raised to the power b.

3.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

Which of the following functions returns the absolute value of a number?

mod()

absval()

fabs()

abs()

Answer explanation

Media Image

For integers, the correct function is abs() (from stdlib.h)

For floating-point numbers, use fabs() (from math.h)

4.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

Which header file is needed for using ceil() and floor() functions?

stdio.h

stdlib.h

math.h

string.h

Answer explanation

Media Image

ceil() gives the smallest integer ≥ number; floor() gives the largest integer ≤ number.

5.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

What does floor(3.8) return?

4.0

3.5

3.8

3.0

Answer explanation

Media Image

floor() rounds down to the nearest integer.

6.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

What does strlen("hello") return?

5

4

Error

6

Answer explanation

Media Image

strlen() counts characters in a string (excluding \0).

7.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

Which function is used to copy one string into another?

strcat()

strcpy()

strlen()

strrev()

Answer explanation

Media Image

strcpy(destination, source) copies the source string into destination.

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?