C Test


C is the father of all languages !!!



int main()
{
FILE *fp;
char str[11],ch;
int i=0;
fp=fopen("INPUT.TXT","r");
while((ch=getc(fp))!=EOF)
{
if(ch=='\n'||ch==' ')
{
str[i]='\0';
strrev(str);
printf("%s",str);
i=0;
}
else
str[i++]=ch;
}
fclose(fp);
return 0;
}
}
}





Correct Answer :   B.   The code reads a text files and display its content in reverse order.







Correct Answer :   C.   float, double, long double.











Correct Answer :   A.   2134







Correct Answer :   B.   Hexadecimal system







Correct Answer :   D.   | operator





Correct Answer :   B.   No


int main()
{
printf("%d %d\n", 32<<1, 32<<0);
printf("%d %d\n", 32<<-1, 32<<-0);
printf("%d %d\n", 32>>1, 32>>0);
printf("%d %d\n", 32>>-1, 32>>-0);
return 0;
}





Correct Answer :   B.   64 32 0 32 16 32 0 32







Correct Answer :   A   


int main()
{
struct emp
{
char name[25];
int age;
float sal;
};
struct emp e[2];
int i=0;
for(i=0; i<2; i++)
scanf("%s %d %f", e[i].name, &e[i].age, &e[i].sal);
for(i=0; i<2; i++)
scanf("%s %d %f", e[i].name, e[i].age, e[i].sal);
return 0;
}





Correct Answer :   C.   Error: Floating point formats not linked Abnormal program termination.


int main()
{
const int x=5;
const int *ptrx;
ptrx = &x;
*ptrx = 10;
printf("%d\n", x);
return 0;
}





Correct Answer :   C.   Error


Submit


Home Test Tutorials Program About Us
www.000webhost.com