Professional Documents
Culture Documents
1. main()
{ int arr[]={ 1,2,3,4 };
int *ptr ;;;;
ptr++ = arr;
printf("%d,%d",ptr[2],arr[2]);
return 0;
}
what is the output :
2. main()
{
char s[10];
scanf ("%s",s);
printf(s);
}
what is the output if input is abcd :
a. prints abcd
b. compiler error
c. prints abcd and 6 junk characters
d. printd s
4.
main()
{
int i;
for (i=7;i<=0;i--)
printf ("hello
");
}
5. main()
{
printf( printf ("world") );
}
a. prints world
b. prints printf ("world")
c. prints nothing
d. compiler error
Computer Concepts
a. compiled only
b. interpreted only
c. both compiled and interpreted
d. nothing
2. c programming approach is
a. Top down
b. bottom up
c. both topdown and bottom up
d. none of the above
ans a:top down approach
a. hard disk
b. cache
c. registers
d. main memory
ans c:registers
a.complie time
b.run time
c.link time
4.load time
1)
#include
main()
{
scanf("%d");
printf();
}
which of the following is correct?
a)compilation error
b)Run time error
c)No output
d)depends on the compiler
ans : a
2)
#include
#define islower(c) ( a <=(c) && (c)<= z )
#define toupper(c) (islower(c)?(c)-( a - A ):(c))
main()
{
char *p="i am fine";
while(*p)
printf("%c",toupper(*p++));
}
a)bcd
b)AFE
c)aFe
d)BCd
ans : b ( macro substitution 3 times)
3)
#include
main()
{
200;
printf("tricky problem");
}
a)warning message
b)compilation error
c)run time error
d)none of these
ans : a
ans : a
ans : c
/* questions on computer concepts */
ans : d
ans : c
ans : d
ans : d
ans : c