|
Question |
Rating |
View Answer |
|
How to write a program for pascal triangle? |
|
View Answer |
|
Write a program to remove comment lines and blank lines from an error free c program. |
|
View Answer |
|
Where is the prototype of the main function i.e how the execution startd from main function and how to find out the size of a function. |
|
View Answer |
|
The program that outputs the given binary or image file |
|
View Answer |
|
What is the difference between text and binary modes?
|
|
View Answer |
|
All the programs are tested under Turbo C/C++ compilers. It is assumed that, „« Programs run under DOS environment, „« The underlying machine is an x86 system, „« Program is compiled using Turbo C/C++ compiler. The program output may depend on the information based on this assumptions (for example sizeof(int) == 2 may be assumed).
Predict the output or error(s) for the following:
i) void main() { int const * p=5; printf("%d",++(*p)); }
|
|
View Answer |
|
main() { extern int i; i=20; printf("%d",i); }
|
|
View Answer |
|
vii)7. main() { int i=-1,j=-1,k=0,l=2,m; m=i++&&j++&&k++||l++; printf("%d %d %d %d %d",i,j,k,l,m); }
|
|
View Answer |
|
main() { char *p; printf("%d %d ",sizeof(*p),sizeof(p)); } |
|
View Answer |
|
main() { int i=3; switch(i) { default:printf("zero"); case 1: printf("one"); break; case 2:printf("two"); break; case 3: printf("three"); break; } }
|
|
View Answer |
|
How can you get the number of elements in an array allocated dynamically at runtime? For example - int *p = (int *) malloc(sizeof(int) * n);
int numElems = ??????? /* n is not available here */
|
|
View Answer |
|
What is the draw back in using friend function in c++
|
|
View Answer |
|
In the following code, in which order the functions would be called? x = f1(23,14)*f2(12/4)+f3();
a) f1, f2, f3 b) f3, f2, f1 c) The order may vary from compiler to compiler d) None of the above
|
|
View Answer |
|
What would be the output of the following program? main() { const int x=5; int *ptrx; ptrx=&x; *ptrx=10; printf("%d",x); }
|
|
View Answer |
|
According to ANSI specifications which is the correct way of declaring main() when it receives command line arguments?
|
|
View Answer |
|
Would the following program compile?
main() { int a=10,*j; void *k; j=k=&a; j++; k++; printf("n%u%u",j,k); }
|
|
View Answer |
|
If the following program (myprog) is run from the command line as myprog friday tuesday sunday, What would be the output?
main(int argc, char *argv[]) { printf("%c",*++argv[1]); }
|
|
View Answer |
|
If the following program (myprog) is run from the command line as myprog friday tuesday sunday, What would be the output?
main(int argc, char*argv[]) { printf("%c",**++argv); }
|
|
View Answer |
|
What would be the output of the following program?
main() { char near * near *ptr1; char near * far *ptr2; char near * huge *ptr3; printf("%d %d %d",sizeof(ptr1),sizeof(ptr2),sizeof(ptr3)); }
|
|
View Answer |
|
What would be the output of the following program?
main() { int y=128; const int x=y; printf("%d",x); }
|
|
View Answer |