Pre-Test
- a)What is the output of C program with strings.?
- What is the output of C Program with arrays.?
- What is the output of C Program?
- How do you accept a Multi Word Input in C Language.?
- What is the output of C Program with String Pointer.?
int main()
{
char str1[]="JOHN";
char str2[20];
str2= str1;
printf("%s",str2);
return 0;
}
J
John\0
Compile error
int main()
{
char str[25];
scanf("%s", str);
printf("%s",str);
return 0;
}
//input: South Africa
South Africa
S
Compile Error
int main()
{
char str[2];
int i=0;
scanf("%s", str);
while(str[i] != '\0')
{
printf("%c", str[i]);
i++;
}
return 0;
}
//Input: KLMN
KLMN
Compile Error
None Of the Above
SCANF
GETS
GETC
FINDS
int main()
{
char country[]="BRAZIL";
char *ptr;
ptr=country;
while(*ptr != '\0')
{
printf("%c", *ptr);
ptr++;
}
return 0;
}
.
BRAZIL
Compile Error
None of the above
