Important Introduction to Programming Short Questions
Chapter: 16
Question 1:
What does *(*(multi+3)+3) refer to in a two-dimensional array?
Answer:
The expression *(*(multi+3)+3) refers to the element in the fourth row and fourth column of a two-dimensional array by using pointer arithmetic and double dereferencing.
Chapter: 17
Question 2:
What is a string in C programming?
Answer:
A string in C programming is a sequence of characters terminated by a null character \0.
Chapter: 17
Question 3:
What data type is used to store a character in C?
Answer:
The char data type is used to store a single character in C, which can include letters, digits, and symbols.
Chapter: 17
Question 4:
How are characters stored in a computer's memory?
Answer:
Characters are stored in a computer's memory using ASCII codes, where each character is represented by a specific integer value.
Chapter: 17
Question 5:
What is the purpose of the ctype.h header file?
Answer:
The ctype.h header file provides functions for testing and manipulating character data, such as checking if a character is a digit or converting case.
Chapter: 17
Question 6:
What does the isdigit function do?
Answer:
The isdigit function checks if a given character is a digit (0-9) and returns true if it is, false otherwise.
Chapter: 17
Question 7:
How does the isalpha function work?
Answer:
The isalpha function checks if a character is an alphabetic letter (a-z or A-Z) and returns true if it is, false otherwise.
Chapter: 17
Question 8:
What is the difference between toupper and tolower functions?
Answer:
The toupper function converts a lowercase letter to uppercase, while tolower converts an uppercase letter to lowercase.
Chapter: 17
Question 9:
What is the purpose of the strcpy function?
Answer:
The strcpy function copies the content of one string into another.
Chapter: 17
Question 10:
How does the strcmp function compare two strings?
Answer:
The strcmp function compares two strings lexicographically and returns a negative value if the first string is less than the second, zero if they are equal, or a positive value if the first string is greater.