Which of the following function sets first n characters of a string to a given c

Home | Discussion Forum

Which of the following function sets first n characters of a string to a given character?

View More Related Question

1) What will be the output of the program ?

  #include<stdio.h>
int main()
{
printf("Study 2 Online", " C Language MCQ\n");
return 0;
}

2) What is the output of this C code?

#include <stdio.h>
int main()
{
char str[11] = "hello";
char *str1 = "world";
strcat(str, str1);
printf("%s %d", str, str[10]);
}

3) 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);
}

4) How will you print \n on the screen?

5) What is the output of this C code?

#include <stdio.h>
int main()
{
char *str = "hello, world\n";
printf("%d", strlen(str));
}

UP Gk Online Test

taiyari24hour.com