Arrays and Strings MCQs
Practice free Arrays and Strings multiple-choice questions with instant answer feedback and step-by-step solutions. Click an option to check yourself, reveal the full explanation, and work through all 133 questions — no login required.
Question 55hard
What will be the output of the program?
#include<stdio.h>
#include<string.h>
void main()
{
char str1[20] = "Hello", str2[20] = " World";
printf("%s", strcpy(str2, strcat(str1, str2)));
}Question 56hard
What will be the output of the program?
#include<stdio.h>
void main()
{
printf(5+"Good Morningn");
}Question 57hard
What will be the output of the program?
#include<stdio.h>
#include<string.h>
void main()
{
char str[] = "Exam\0Veda";
printf("%s", str);
}Advertisement
Question 58medium
Which of the following correctly accesses the seventh element stored in arr, an array with 100 elements?
Question 59easy
What is the return value of the following statement if it is placed in C program? strcmp("ABC", "ABC");
Question 60easy
int a[5] = {1,2,3} What is the value of a[4]?
Advertisement
Question 61hard
What will be the correct output of the following program?
#include<string.h>
void main()
{
char str[] = "C EXAMINATION", rev[17];
int i = strlen(str), j=0;
for( ; i>=0; rev[j++] = str[i--])
rev[j] = str[j] ;
puts(rev);
}Question 62medium
The function sprintf() works like printf(), but operates on ..........
Question 63easy
String concatenation means -