C Programming: Strings and Functions

FeistyZeal avatar
FeistyZeal
·
·
Download

Start Quiz

Study Flashcards

14 Questions

What is the purpose of the strlen function in the string.h library?

To return the length of a string

What is the correct format specifier to output a string in C?

%s

What is the purpose of the puts function in the string.h library?

To display a string

How do you declare a variable of type string in C?

Use an array of char

What is the purpose of the strcpy function in the string.h library?

To copy a string into another string

What is the purpose of the strcat function in the string.h library?

To concatenate two strings

What is the purpose of the gets() function in the given C program?

To input the value of a string

What is the output of the puts() function when used with a string variable?

The value of the string itself

What is the purpose of the strcpy() function in the given C program?

To copy the value of one string to another

What is the purpose of the strcat() function in the given C program?

To concatenate two strings

What is the output of the strlen() function when used with a string variable?

The length of the string

What is the condition for displaying 'str1 is Long String' in the given exercise?

If the length of str1 is greater than 15

Which header file is used to perform mathematical operations in C programming?

math.h

What is the purpose of the scanf() function in the given C program?

To input the value of an integer

Learn about strings in C programming, how to declare and output strings using arrays of char and the printf function.

Make Your Own Quizzes and Flashcards

Convert your notes into interactive study material.

Get started for free
Use Quizgecko on...
Browser
Browser