1. Trang chủ
  2. » Thể loại khác

IT Ebooks - Trang Minh Truc's website C++,Test 3

5 74 0

Đang tải... (xem toàn văn)

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 5
Dung lượng 3,38 MB

Nội dung

Test - C++ main() { int x=5; for(;x!=0;x ) { printf("x=%d\n", x ); } } A 5, 3, B 4, 3, 2, 1, C 5, 4, 3, 2,1 D none of the above main() { int x=5; clrscr(); for(;x> (i - (i -1))); } } A 512, 512, 512, 512, 512 B 256, 256, 0, 0, C 512, 256, 0, 0, D 256, 256, 256, 256, 256 main() { if (!(1&&0)) { printf("OK I am done."); } else { printf("OK I am gone."); } } A none of the above B compile error C OK I am gone D OK I am done main() { if ((1||0) && (0||1)) { printf("OK I am done."); } else { printf("OK I am gone."); } } A none of the above B compile error C OK I am gone D OK I am done main() { signed int bit=512, mBit; { mBit = ~bit; bit = bit & ~bit ; printf("%d %d", bit, mBit); }} A 0, -513 B 512, C 0, 513 D 0, 10 What would be the output of the following program? main() { int i=4; switch(i) { default: printf("\n A mouse is an elephant built by the Japanese"); case 1: printf(" Breeding rabbits is a hair raising experience"); break; case 2: printf("\n Friction is a drag"); break; case 3: printf("\n If practice make perfect, then nobody's perfect"); } } A A mouse is an elephant built by the Japanese B Breeding rabbits is a hare raising experience C A mouse is an elephant built by the Japanese Breeding rabbits is a hare raising experience D None of the above 9/10/2009 3:17 PM 11 What is the output of the following program? #define SQR(x) (x*x) main() { int a,b=3; a= SQR(b+2); printf("%d",a); } A 25 B 11 C Error D Garbage Value 12 In which line of the following, an error would be reported? #define CIRCUM(R) (3.14*R*R); main() { float r=1.0,c; c= CIRCUM(r); printf("\n%f",c); if(CIRCUM(r))==6.28) printf("\nGobbledygook"); } A Line B Line C Line D Line 13 We should not read after a write to a file without an intervening call to fflush(), fseek() or rewind() A True B False 14 If the program (myprog) is run from the command line as myprog , What would be the output? main(int argc, char *argv[]) { int i; for(i=0;i> (i - (i -1 ))); } } A 512, 512,... Japanese B Breeding rabbits is a hare raising experience C A mouse is an elephant built by the Japanese Breeding rabbits is a hare raising experience D None of the above 9/10/2009 3: 17 PM 11 What is

Ngày đăng: 09/12/2017, 12:03

w