Worksheetsday8
Total questions: 10
Worksheet time: 10mins
10
9
11
100
phisoft
Amphisoft
ft
Am
What will be output of the given code?
#include<stdio.h>
int main(){
char str[100] = "cprog";
printf ("%d", sizeof(str));
return 0;
}
100
1
5
4
Fill in the blanks in the below program to print "her".
#include <stdio.h>
int main() {
char arr[] = "teacher";
printf("%s", (a) );
return 0;
}
What will be the output of the given code?
#include <stdio.h>
int main() {
printf("java","compiler");
return 0;
}
compile time error
java
java compiler
compiler
What will be the output of the given code?
#include<stdio.h>
#include<string.h>
int main(){
char str[] = "java\0compiler\0";
printf("%s\n", str);
return 0;
}
java
compiler
java compiler
compile time error
What will be the output of the given code?
#include<stdio.h>
int main(){
printf(3+"java compiler\n");
return 0;
}
java
comp
a compiler
iler
error
What is the Format specifier used to print a String or Character array in C Printf or Scanf function.?
%c
%C
%s
%S
What is the output of C Program with arrays.?
int main()
{
char str[]={"C","A","T","\0"};
printf("%s",str);
return 0;
}
C
CAT
CAT\0
Compiler error
java
ja
Compiler error
none of the above
