InstructionsTotal Questions: 20Total Minutes: 20This ExamTray Free Online Exam or MCQ Quiz tests your C Programming Skills on C Strings, Character Arrays and String Pointers. Examples are given as questions and answers. Easily Attend Competitive Exams and Job Interview Questions. Go through C Theory Notes on Strings before attempting this test. All the Best Challenge SCORE0 / 20Take This Exam 1*2*3*4*5*6*7*8*9*10*11*12*13*14*15*16*17*18*19*20*Q Buttons 1) What is the ASCII value of NULL or \0.? A) 0 B) 1 C) 10 D) 49 2) A character constant is enclosed by.? A) Left Single Quotes B) Right Single Quotes C) Double Quotes D) None of the above 3) Choose a correct statement about C String. A) A string is a group of characters enclosed by double quotes. B) If a string is defined with double quotes, NULL is automatically added at the end. C) Size of a string is without counting NULL character at the end D) All the above 4) A C string elements are always stored in.? A) Random memory locations B) Alternate memory locations C) Sequential memory locations D) None of the above 5) What is the output of C program with strings.? int main() { char var='b'; printf("%d ", sizeof("a")); printf("%d ", sizeof('b')); printf("%d ", sizeof(10)); printf("%d ", sizeof(var)); } //int size is 2 bytes A) 1 1 1 1 B) 2 1 2 1 C) 2 2 2 1 D) 2 2 2 2 6) What is the output of C program with strings.? int main() { char str[]="JACKIE CHAN"; int i=0; while(str[i] != 0) { printf("%c",str[i]); i++; } return 0; } A) JJJJJJ JJJJ B) JACKIE CHAN C) Compiler error D) None of the above 7) What is the output of C program with strings.? int main() { char str[]="ANDAMAN"; int i=0; while(str[i] != '\0') { printf("%c",str[i]); i++; } return 0; } A) AAAAAAA B) ANDAMAN C) Compiler error D) None of the above Ad 8) What is the output of C program with strings.? int main() { char str[]="MALDIVES"; printf("%s ",str); puts(str); return 0; } A) MALDIVES B) MALDIVES MALDIVES C) M MALDIVES D) None of the above 9) What is the output of C program with strings.? int main() { char str[3]="SUNDAY"; printf("%s",str); } A) SUN B) SUNgarbagevalues C) compiler error D) None of the above 10) Choose a correct C statement about String functions.? A) int n=strlen("abc") returns 3. B) strupr("abc") returns ABC C) strlwr("Abc") returns abc D) All the above 11) Choose a correct C statement about String functions.? A) strrev("abcD") returns Dcba. B) strcmp("abc", "bcd") returns a negative number C) strcmp("234","123") returns a positive number D) All the above 12) Choose a correct C statement about String functions.? A) toupper('a') returns A B) tolower('D') returns d. C) strcmp("123","12345") returns a negative number D) All the above 13) What is the output of C program.? int main() { char str1[]="JAMES,"; char str2[15]="BOND "; strcat(str2,str1); printf("%s",str2); printf("%s",str1); } A) JAMES BOND,JAMES, B) JAMES,JAMES, C) BOND JAMES,JAMES, D) None of the above 14) What is the output of C program.? int main() { printf("%c","HUMPTY"[2]); } A) U B) M C) HUMPTY D) None of the above Ad 15) What is the output of C program.? int main() { char str1[] = "FIRST"; char str2[20]; strcpy(str2,str1); printf("%s %s ",str1,str2); printf("%d", (str1!=str2)); printf("%d", strcmp(str1,str2)); return 0; } A) FIRST FIRST 0 0 B) FIRST FIRST 1 1 C) FIRST FIRST 1 0 D) FIRST FIRST 0 1 16) What is the output of C program with array of pointers to strings.? int main() { char *code[]={"IN","USA","K"}; printf("%s", code[1]); return 0; } A) IN B) U C) USA D) Compiler error 17) What is the output of C program with String arrays.? int main() { char code[3][4]={"IN","USA","K"}; printf("%s", code[1]); return 0; } A) IN B) USA C) K D) Compiler error 18) What is the output of C program with array of pointers to strings.? int main() { char *code[2]; code[0]= (char *)malloc(4); strcpy(code[0], "IND"); printf("%s", code[0]); return 0; } A) I B) IN C) IND D) Compiler error 19) What is actually passed to PRINTF or SCANF functions.? A) Value of String B) Address of String C) End address of String D) Integer equivalent value of String 20) What is the output of C program with strings.? int main() { char *code="JUMPER"; if(code[6]=='\o') { printf("SUMMER"); } else { printf("WINTER"); } return 0; } A) SUMMER B) WINTER C) Compiler error D) None of the above FINISH EXAM 1*2*3*4*5*6*7*8*9*10*11*12*13*14*15*16*17*18*19*20*PREVStrings, Char Arrays, Pointers - Online Test 1 NEXTStructures and Pointers - Online Test 1 Certification Group ID 3864