How will you print on the screen?
printf("");
echo "";
printf('');
printf("");
SHOW ANSWERWhat will be the output of the program ?
#include<stdio.h>
int main()
{
printf(5+"Good Morning");
return 0;
}
Good Morning
Good
M
Morning
SHOW ANSWERWhich of the following statement is correct?
strcmp(s1, s2) returns a number less than 0 if s1>s2
strcmp(s1, s2) returns a number greater than 0 if s1<s2
strcmp(s1, s2) returns 0 if s1==s2
strcmp(s1, s2) returns 1 if s1==s2
SHOW ANSWERThe library function used to find the last occurrence of a character in a string is
strnstr()
laststr()
strrchr()
strstr()
SHOW ANSWERWhat will be the output of the program ?
#include
#include
int main()
{
char str[] = "AstiwzQUIZ";
printf("%s", str);
return 0;
}
QUIZ
Astiwz
Astiwz QUIZ
Astiwz QUIZ
SHOW ANSWERWhich of the following function is used to find the first occurrence of a given string in another string?
strchr()
strrchr()
strstr()
strnset()
SHOW ANSWERWhat will be the output of the program If characters 'a', 'b' and 'c' enter are supplied as input?
#include<stdio.h>
int main()
{
void fun();
fun();
printf("");
return 0;
}
void fun()
{
char c;
if((c = getchar())!= '')
fun();
printf("%c", c);
}
abc abc
bca
Infinite loop
cba
SHOW ANSWERWhat will be the output of the program ?
#include<stdio.h>
int main()
{
printf("Astiwz", "QUIZ");
return 0;
}
Error
Astiwz QUIZ
Astiwz
QUIZ
SHOW ANSWERWhich of the following function is correct that finds the length of a string?
int xstrlen(char *s)
{
int length=0;
while(*s!='')
{ length++; s++; }
return (length);
}
int xstrlen(char s)
{
int length=0;
while(*s!='')
length++; s++;
return (length);
}
int xstrlen(char *s)
{
int length=0;
while(*s!='')
length++;
return (length);
}
int xstrlen(char *s)
{
int length=0;
while(*s!='')
s++;
return (length);
}
SHOW ANSWERWhat will be the output of the program ?
#include<stdio.h>
int main()
{
char str[7] = "ASTIWZ";
printf("%s", str);
return 0;
}
Error
ASTIWZ
Cannot predict
None of above
SHOW ANSWERWhat will be the output of the program ?
#include<stdio.h>
int main()
{
char *names[] = { "Suresh", "Siva", "Sona", "Baiju", "Ritu"};
int i;
char *t;
t = names[3];
names[3] = names[4];
names[4] = t;
for(i=0; i<=4; i++)
printf("%s,", names[i]);
return 0;
}
Suresh, Siva, Sona, Baiju, Ritu
Suresh, Siva, Sona, Ritu, Baiju
Suresh, Siva, Baiju, Sona, Ritu
Suresh, Siva, Ritu, Sona, Baiju
SHOW ANSWERWhat will be the output of the program ?
#include<stdio.h>
#include<string.h>
int main()
{
char str[] = "AstiwzQUIZ";
printf("%d", strlen(str));
return 0;
}
10
6
5
11
SHOW ANSWERWhat will be the output of the program ?
#include<stdio.h>
#include<string.h>
int main()
{
static char str1[] = "dills";
static char str2[20];
static char str3[] = "Daffo";
int i;
i = strcmp(strcat(str3, strcpy(str2, str1)), "Daffodills");
printf("%d", i);
return 0;
}
0
1
2
4
SHOW ANSWER