<<= Back Next =>>
You Are On Multi Choice Question Bank SET 176

8801. What will be the output of the program? #include<stdio.h> #define MIN(x, y) (x<y)? x : y; int main() { int x=3, y=4, z; z = MIN(x+y/2, y-1); if(z > 0) printf("%d\n", z); return 0; }





8802. What will be the output of the program? #include #define str(x) #x #define Xstr(x) str(x) #define oper multiply int main() { char opername = Xstr(oper); printf("%s\n", opername); return 0; }





8803. What will be the output of the program? #include<stdio.h> #define MESS junk int main() { printf("MESS\n"); return 0; }





8804. What will be the output of the program? #include<stdio.h> #define PRINT(i) printf("%d,",i) int main() { int x=2, y=3, z=4; PRINT(x); PRINT(y); PRINT(z); return 0; }





8805. What will be the output of the program? #include<stdio.h> #define MAX(a, b, c) (a>b ? a>c ? a : c: b>c ? b : c) int main() { int x; x = MAX(3+2, 2+7, 3+7); printf("%d\n", x); return 0; }





8806. Point out the error in the program #include<stdio.h> #define SI(p, n, r) float si; si=pnr/100; int main() { float p=2500, r=3.5; int n=3; SI(p, n, r); SI(1500, 2, 2.5); return 0; }





8807. Point out the error in the program #include<stdio.h> int main() { int i; #if A printf("Enter any number:"); scanf("%d", &i); #elif B printf("The number is odd"); return 0; }





8808. Which of the following are correct preprocessor directives in C? 1: #ifdef 2: #if 3: #elif 4: #undef





8809. Which of the following are correctly formed #define statements in C?





8810. If the file to be included doesn't exist, the preprocessor flashes an error message.



8811. Preprocessor directive #undef can be used only on a macro that has been #define earlier



8812. There exists a way to prevent the same file from getting #included twice in the same program.



8813. A preprocessor directive is a message from programmer to the preprocessor.



8814. Macro calls and function calls work exactly similarly.



8815. A macro must always be defined in capital letters.



8816. Macros have a local scope.



8817. Every C program will contain at least one preprocessor directive.



8818. Preprocessor directive #ifdef .. #else ... #endif is used for conditional compilation.



8819. Macros with arguments are allowed



8820. In a macro call the control is passed to the macro.



8821. A header file contains macros, structure declaration and function prototypes.



8822. The preprocessor can trap simple errors like missing declarations, nested comments or mismatch of braces.



8823. A preprocessor directive is a message from compiler to a linker.



8824. Once preprocessing is over and the program is sent for the compilation the macros are removed from the expanded source code.



8825. Will the program compile successfully? #include<stdio.h> #define X (4+Y) #define Y (X+3) int main() { printf("%d\n", 4X+2); return 0; }



8826. Would the following typedef work? typedef #include l;



8827. Will the program compile successfully? #include<stdio.h> int main() { printf("India" "BIX\n"); return 0; }



8828. It is necessary that a header files should have a .h extension?



8829. Will the program compile successfully? #include<stdio.h> int main() { #ifdef NOTE int a; a=10; #else int a; a=20; #endif printf("%d\n", a); return 0; }



8830. Will the following program print the message infinite number of times? #include<stdio.h> #define INFINITELOOP while(1) int main() { INFINITELOOP printf("IndiaBIX"); return 0; }



8831. Will it result in to an error if a header file is included twice?




8832. What will the SWAP macro in the following program be expanded to on preprocessing? will the code compile? #include<stdio.h> #define SWAP(a, b, c)(c t; t=a, a=b, b=t) int main() { int x=10, y=20; SWAP(x, y, int); printf("%d %d\n", x, y); return 0; }





8833. In which stage the following code #include<stdio.h> gets replaced by the contents of the file stdio.h





8834. Which of the following is most suitable for the core of electromagnets?





8835. Who among the following has not been awarded with the ‘Bharat Ratna’?





8836. What will be the output of the program (myprog.c) given below if it is executed from the command line? cmd> myprog one two three / myprog.c / #include<stdio.h> int main(int argc, char argv) { printf("%c\n", ++argv); return 0; }





8837. What will be the output of the program (myprog.c) given below if it is executed from the command line? cmd> myprog one two three / myprog.c / #include<stdio.h> #include<stdlib.h> int main(int argc, char argv) { printf("%s\n", ++argv); return 0; }





8838. What will be the output of the program (sample.c) given below if it is executed from the command line (Turbo C in DOS)? cmd> sample 1 2 3 / sample.c / #include<stdio.h> int main(int argc, char argv[]) { int j; j = argv[1] + argv[2] + argv[3]; printf("%d", j); return 0; }





8839. What will be the output of the program (sample.c) given below if it is executed from the command line (turbo c under DOS)? cmd> sample Good Morning / sample.c / #include<stdio.h> int main(int argc, char argv[]) { printf("%d %s", argc, argv[1]); return 0; }





8840. What will be the output of the program #include<stdio.h> void fun(int); int main(int argc) { printf("%d ", argc); fun(argc); return 0; } void fun(int i) { if(i!=4) main(++i); }





8841. What will be the output of the program (sample.c) given below if it is executed from the command line? cmd> sample ".c" / sample.c / #include<stdio.h> int main(int argc, int argv) { int i; for(i=1; i<argc; i++) printf("%s\n", argv[i]); return 0; }





8842. What will be the output of the program if it is executed like below? cmd> sample / sample.c / #include<stdio.h> int main(int argc, char argv) { printf("%s\n", argv[argc-1]); return 0; }





8843. What will be the output of the program (sample.c) given below if it is executed from the command line? cmd> sample friday tuesday sunday / sample.c / #include<stdio.h> int main(int argc, char argv[]) { printf("%c", ++argv); return 0; }





8844. What will be the output of the program (myprog.c) given below if it is executed from the command line? cmd> myprog friday tuesday sunday / myprog.c / #include<stdio.h> int main(int argc, char argv[]) { printf("%c", ++argv[1]); return 0; }





8845. What will be the output of the program (sample.c) given below if it is executed from the command line? cmd> sample one two three / sample.c / #include<stdio.h> int main(int argc, char argv[]) { int i=0; i+=strlen(argv[1]); while(i>0) { printf("%c", argv[1][--i]); } return 0; }





8846. What will be the output of the program in Turbo C? #include<stdio.h> int main(int argc, char argv, char env[]) { int i; for(i=1; i<argc; i++) printf("%s\n", env[i]); return 0; }





8847. What will be the output of the program (sample.c) given below if it is executed from the command line? cmd> sample Jan Feb Mar / sample.c / #include<stdio.h> #include<dos.h> int main(int arc, char arv[]) { int i; for(i=1; i<_argc; i++) printf("%s ", _argv[i]); return 0; }





8848. What will be the output of the program (sample.c) given below if it is executed from the command line? cmd> sample monday tuesday wednesday thursday / sample.c / #include<stdio.h> int main(int argc, char argv[]) { while(--argc>0) printf("%s", ++argv); return 0; }





8849. If the following program (myproc.c) is present in the directory "C:\TC" then what will be output of the program if run it from DOS shell? / myproc.c / #include<stdio.h> int main(int argc, char argv[]) { printf("%s", argv[0]); return 0; }





8850. What will be the output of the program (myprog.c) given below if it is executed from the command line? cmd> myprog one two three / myprog.c / #include<stdio.h> int main(int argc, char argv[]) { int i; for(i=1; i<argc; i++) printf("%c", argv[i][0]); return 0; }





<<= Back Next =>>
Terms And Service:We do not guarantee the accuracy of available data ..We Provide Information On Public Data.. Please consult an expert before using this data for commercial or personal use | Powered By:Omega Web Solutions
© 2002-2017 Omega Education PVT LTD...Privacy | Terms And Conditions
Question ANSWER With Solution