C Language MCQ - English
Which of the following function sets first n characters of a string to a given c
Home | Discussion ForumWhich of the following function sets first n characters of a string to a given character?
Answer : B
View More Related Question
1) How will you print \n on the screen?
2) What is the output of this C code?
#include <stdio.h>
int main()
{
char *str = "hello";
char str1[5];
strcpy(str, str1);
printf("%s", str1);
}
3) What will be the output of the program ? #include<stdio.h>
int main()
{
printf(2+"C Programming MCQ on Study 2 Online\n");
return 0;
}
View Answer
4) What is the output of this C code?
#include <stdio.h>
int main()
{
char *str = "hello, world\n";
printf("%d", strlen(str));
}
5) What is the output of this C code?
#include <stdio.h>
int main()
{
char *str = "hello, world";
char *str1 = "hello, world";
if (strcmp(str, str1))
printf("equal");
else
printf("unequal");
}