MCQOPTIONS
Saved Bookmarks
This section includes 6 Mcqs, each offering curated multiple-choice questions to sharpen your C Programming knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
Read the following program. findPalindrome { char *str; char *str1; str = str1; while(str1 != NULL) { str1++; } while(str!=NULL) { if(str1--!= str++) { printf("Not palindrome"); return } } printf("Palindrome"); } This function will work correctly for which string? |
| A. | even palindrome |
| B. | odd palindrome |
| C. | both even and odd |
| D. | none of the above |
| Answer» D. none of the above | |
| 2. |
Which is true about isalnum(ch), where ch is an int that can be represented as an unsigned? |
| A. | Nothing |
| B. | 0 if not isalpha(ch) or not isdigit(ch) |
| C. | Non-zero if isalpha(ch) or isdigit(ch) |
| D. | Both 0 if not isalpha(ch) or not isdigit(ch) & Non-zero if isalpha(ch) or isdigit(ch) |
| E. | None of these |
| Answer» E. None of these | |
| 3. |
Which is true about isupper(ch), where ch is an int that can be represented as an unsigned? |
| A. | 0 if ch is not upper case |
| B. | Non-zero if ch is upper case |
| C. | Both 0 if ch is not upper case & Non-zero if ch is upper case |
| D. | Nothing |
| E. | None of these |
| Answer» D. Nothing | |
| 4. |
Which is true about isaplpha(ch), where ch is an int that can be represented as an unsigned? |
| A. | 0 if ch is not alphabetic |
| B. | Non-zero if ch is alphabetic |
| C. | Both 0 if ch is not alphabetic & Non-zero if ch is alphabetic |
| D. | Non-zero if d is alphabetic |
| E. | None of these |
| Answer» D. Non-zero if d is alphabetic | |
| 5. |
What will be the value of var for the following C statement? |
| A. | strcmp has void return-type |
| B. | 1 |
| C. | 0 |
| D. | -1 |
| E. | None of these |
| Answer» E. None of these | |
| 6. |
The following C expression can be substituted for? |
| A. | if (isalphanum(c)) |
| B. | if (isalphanumeric(c)) |
| C. | if (isalnum(c)) |
| D. | All of above |
| E. | None of these |
| Answer» F. | |