Monday, December 1, 2008

c programming quiz with solution

1)What are the files which are automatically opened when a C file is executed?

Answer:
stdin, stdout, stderr (standard input,standard output,standard error).

2) what will be the position of the file marker?
a: fseek(ptr,0,SEEK_SET);
b: fseek(ptr,0,SEEK_CUR);

Answer :
a: The SEEK_SET sets the file position marker to the starting of the file.
b: The SEEK_CUR sets the file position marker to the current position
of the file.

3) main()
{
char name[10],s[12];
scanf(" \"%[^\"]\"",s);
}
How scanf will execute? 

Answer:
First it checks for the leading white space and discards it.Then it matches with a quotation mark and then it  reads all character upto another quotation mark.

4)What is the problem with the following code segment?

while ((fgets(receiving array,50,file_ptr)) != EOF);

Answer & Explanation:
fgets returns a pointer. So the correct end of file check is checking for != NULL.

5) main()
{
main();
}


Answer:
 Runtime error : Stack overflow.
Explanation:
main function calls itself again and again. Each time the function is called its return address is stored in the call stack. Since there is no condition to terminate the function call, the call stack overflows at runtime. So it terminates the program and results in an error.

ALL PLACEMENT TECHNICAL INTERVIEW QUESTION  BANCK   

1Technical /logical interview questions and solution in C language |2Technical / logical interview questions in C language |3C programming Language Technical Questions And Answers |4C Language Technical Questions And Answers |5C Language Technical Interview Questions And solution |6C Language Technical Interview Questions And Answers |7C Language Interview Questions And Solution |8online Placement Question of c programming languge |9online placement c programming question|10online test of c programming languge|11placement c programming quiz with solution |12c programming quiz with solution |13C programming languge quiz with solution |14C quiz with solution |15C languge quiz with solution  |16C programming quiz with solution |17questions with answer in C programming language|18Technical questions with solution in C programming language  |19Technical questions with answer in C programming language |20placement Question and answer in Simple C Language |21Simple C Language placement Question and answer22Simple C programming Question and answer |23Simple C programming Question and answer |24Simple C Language Question and answer |25c progrmming Interview question with solution  |26Technical placement question with solution in c progrmming |27placement c progrmming Question with Answer  |28c progrmming placement question with solution  |29 placement c progrmming languge question with Answer |30placement c progrmming languge question with solution  |31c progrmming languge placement question with solution  |32c languge placement question with solution |33placement c programming languge problem with solution  |34c programming languge placement problem with solution  |35c language placement problem with solution  |36Placement c languge problem with solution  |37c language problem with answer  |38c language problem with solution  |

No comments:

Post a Comment

Thanks to given comments.......

My Blog List