Menu Close

C exam on Strings

Please enter your email:

1.

Output of the following Code?

#include<stdio.h>
int main()
{
  char s[] = "Live\0Tution";
  printf("%s ", s);
  return 0;
}

 

 
 
 
 

2.

Output of the following Code?

#include<stdio.h>
#include<string.h>
int main()
{
  char s[]="Hello";
  int x ;
  if(x=printf("%d ",strlen(s)))
    printf("%d ",++x);
}

 

 
 
 
 

3.

Output of the following Code?

#include<stdio.h>
int main()
{
  char s[]="Live\0Tution";
  if(printf("%s",s))
    printf("Class");
  else
    printf("Tution");
}

 

 
 
 
 

4.

Output of the following Code?

#include<stdio.h>
#include<string.h>
int main()
{
  char s1[10] = "hello";
  char s2[10] = "world";
  strncat(s1, s2, 2);
  printf("%s", s1+1);
  return 0;
}

 

 
 
 
 

5.

Output of the following Code?

#include<stdio.h>
int main()
{
 	char s1[] = "C-Tutorial";
 	char s2[] = "C-Tutorial";
 	if(s1==s2)
    printf("C Easy");
 	else
  printf("Need to analyze");
  return 0;
}

 

 
 
 
 

6.

#include<stdio.h>
int main()
{
  char s[15] = "LiveTution" ;
  printf("%c", s);
  return 0;
}

 

 

 
 
 
 

7.

Which function helps to read a multi-word string?

 
 
 
 

8.

Output of the following Code?

#include<stdio.h>
int main()
{
  char s[]="Online";
  int x=1,y;
  y=x++ + ++x;
  printf("%c ",s[++y]);
  return 0;
}

 

 
 
 
 

9.

Output of the following Code?

#include<stdio.h>
int main()
{
  char s[10] = "CQuestions";
  printf("%c %c ", 3[s], s[4]);
  return 0;
}

 

 
 
 
 

10.

Output of the following Code?

#include<stdio.h>
int main()
{
  char x[]="HELLO";
  int i=1;
  x[i] = x[++i] + 3;
  printf("%s ", x);
}

 

 
 
 
 

Question 1 of 10