NEW
Font size
WorksheetsC Programming Day-10
Total questions: 10
Worksheet time: 5mins
1. What is the correct function to calculate the square root of a number in C?
sqrt()
pow()
sqr()
root()
What does the function pow(2, 3) return?
5
6
7
8
Which of the following functions returns the absolute value of a number?
mod()
absval()
fabs()
abs()
Which header file is needed for using ceil() and floor() functions?
stdio.h
stdlib.h
math.h
string.h
What does floor(3.8) return?
4.0
3.5
3.8
3.0
What does strlen("hello") return?
5
4
Error
6
Which function is used to copy one string into another?
strcat()
strcpy()
strlen()
strrev()
What is the output of strcmp("abc", "abc")?
1
0
-1
Error
What does strcat("Hello", "World") do?
Joins the strings and stores in the first string's memory
Throws an error
Compares the strings
Joins the strings and stores in a new variable
Which function is used to find a substring in a string?
strchr()
strstr()
strlen()
strcpy()
