Question: QUESTION 15 What will be the output of following code? #include #include int main() { static char str1[] = cester; static char str2[20]; static char
QUESTION 15
-
What will be the output of following code?
#include
#include
int main()
{
static char str1[] = "cester";
static char str2[20];
static char str3[] = "Wor";
int i;
i = strcmp(strcat(str3, strcpy(str2, str1)), "Worcester");
printf("%d", i);
return 0;
}
A. 1
B. -1
C. 2
D. 0
2 points
QUESTION 16
-
What will be the output of following statements?
char s[25] = "Hello";
int i=0;
char ch;
ch = s[++i];
printf("%c", ch);
ch = s[i++];
printf("%c", ch);
A. el
B. ll
C. ee
D. He
2 points
QUESTION 17
-
What will be the output of following statements?
int i;
char a[] = "";
if(printf("%s", a))
printf("The string is empty");
else
printf("The string is not empty");
A. The string is empty
B. The string is not empty
C. No output
D. 0
2 points
QUESTION 18
-
What will be the output of following statements?
char str1[] = "Hello";
char str2[] = "Hello";
if(str1 == str2)
printf("Equal");
else
printf("Unequal");
A. Equal
B. Unequal
C. Error
D. None of the above
2 points
QUESTION 19
-
What will be the output of following statement?
printf("%c", "abcdefgh"[4]);
A. Run-time Error
B. Compile-time Error
C. e
D. abcdefgh
2 points
QUESTION 20
-
What will be the output of following program?
#include
int fun(int);
int main()
{
float k=3;
fun(k=fun(fun(k)));
printf("%f", k);
return 0;
}
int fun(int i)
{
i++;
return i;
}
A. 3.000000
B. 5.000000
C. 4.000000
D. 6.000000
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
