1. Trang chủ
  2. » Tất cả

100 c interview questions answers

12 414 0
Tài liệu đã được kiểm tra trùng lặp

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

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 12
Dung lượng 82,71 KB

Nội dung

1 ans: (a) reason: you cannot declare structure as unsized array ans: (b) reason: The return st returns x value first as it is and then decrements its value Its post decrement ans: (e) reason: %p represents the pointer format specifier It prints the value in hexa decimal upto four digits ans: (b) ans: (b) reason: The values in the if st () is said to be in the stack So the last element in the stack is taken as check value(zero/non-zero) Here TRUE is -1 i.e success stateand x+y is printed /* Unsolved*/ ans: (c) reason: Static initializes all to ans: (b) reason: char pointer size = int pointer size = ans: (d) reason: 10 ans: (c) reason: printf returns the total no of characters it prints on the screen 11 ans: (c) unsolved*/ 12 reason: ;;; doesnot matter This indicates only an empty statement The o/p will be 3,1 13 ans: (b) 14 ans: (d) reason: The puts prints and places the cursor in the next line, whereas the printf prints and places the cursor in the same line 15 ans: (c) reason: You need to put '=' sign at show ie the correct st is end=(char*)(show=(char*)strcpy(start,"MISPIS,")); or else expression error 16 ans: (e) reason: The _fastcall keyword is reserved for programming under Windows and OS/2 17 ans: (a) reason: The strcmp returns if zone==target, If the ?: assigns fail st i.e This is false value for IF st and hence else part is executed 18 ans: (c) reason: t1 is an array So you need to specify the subscript value while you assign any element to it char *t1; t1="craft" is correct since *t1 is a pointer and it points to the starting addr of the craft 19 ans: (b) unsolved 20 ans: (b) 21 ans: (a) reason: Its a static array 22 ans: (b) unsolved 23 ans : (a) 24 ans: (d) 25 ans: (c) reason: c+ +100 is not valid as c=c+100 26 ans: (d) 27 ans: (a) 28 ans: (b) 29 ans: (a) 30 ans:(c) 31 ans: (d) 32 ans: (e) reason: incompatiable type conversions 33 ans: (c) reason: odd no AND with gives TRUE value always 34 ans: (b) reason: if we mention the string as two dimentional(for more than one dim) array with in printf statement,then we should give '&'symbol 35 ans: (b) reason: res=0+1/5; res=1/5+1/4; res=1/5+1/4+1/3; res=1/5+1/4+1/3+1/2+1/1; At last time res=1/5+1/4+1/3+1/2+1/1+1/0; ^ | zero divide occur 36 ans: (b) reason: '%c' mainly used for print one charactor We can't specify formate output within '%c' 37 ans: (b) reason: can not modify constant value It is a fixed value for entire program 38 ans: (b) reason: 'argc' holds number of arguments argc consist always value becase file name is one of the input therefore 1

Ngày đăng: 07/02/2013, 09:37

TỪ KHÓA LIÊN QUAN

w