Wednesday, August 12, 2009

BASIC C

Correct Questions (24 / 30)
1. What does the following C program results?
main()
{
int exforsys=100;
int test[exforsys];
for(j=1;j<=exfosys;j++)
{
scanf("%d",&exforsys[j]);
}
}
Answer: Gives Error
2. Which of the following can be used to append one string at the end of another?
Answer: strcat
3. Which of the following is not a BITWISE operator in C program?
Answer: &&
4. malloc is declared in
Answer: stdlib.h
5. The notation for preprocessor directive is
Answer: #
6. Which of the following denote exforsys pointing to a character array?
Answer: char *exforsys;
7. Which takes the first precedence in evaluation among the following operators?
Answer: !
8. How is a structure variable named as test declared for a structure named as typedef struct exforsys?
Answer: struct exforsys test;
9. The address of variable ex is got by using
Answer: &ex;
10. Array of structure is
Answer: An array in which each element is a structure
11. The exit() function is present in the header file
Answer: stdlib.h
12. Which of the following is used to call a function named as exforsys?
Answer: exforsys()
13. What is the Boolean value of a false statement resulting in a C program?
Answer: 0
14. Which of the following denote special operators in C?
Answer: ,
15. The integer array exforsys declared as
int exforsys[30];
In the above array the thirtieth element is present in
Answer: exforsys[29]
16. What is the notation that appears after the case statement?
Answer: :
17. Which of the following function is present in the header file
Answer: isalpha
18. Which of the following data type occupied 1 byte?
Answer: char
19. A function calling itself repeatedly until a specific condition is satisfied is called as
Answer: recursion
20. Which of the following are used with switch statement?
Answer: All the Above
21. Which of the following deals with single character?
Answer: Both A and B
22. Which of the following denotes the two-dimensional array named as exforsys with integer elements?
Answer: int exforsys[10][10];
23. Which of the following are used in dynamic memory allocation?
Answer: All the Above
24. What is the output of the following program?
main()
{
printf("%d",-5/-4);
}
Answer: 1

Incorrect Questions (6 / 30)
1. The modifier used for carriage return is
Answer: r
2. Which of the following can return a value?
Answer: function
3. Which of the following reads a single character but does not display the character on screen?
Answer: getch
4. Which of the following denote array of character strings?
Answer: argv
5. Which of the following denote invalid character constants in C?
Answer: 'wer'



CORRECT ANSWER



1. The left shift operator in C program is denoted by
Answer: <<
2. Which of the following statement is FALSE?
Answer: There is semicolon at the end of a #define
3. Which of the following is not a BITWISE operator in C program?
Answer: &&
4. Which of the following is used to receive a single string?
Answer: gets
5. Which of the following is present in the function declaration?
Answer: Both A and B
6. How is the integer pointer ex declared?
Answer: int *x;
7. The function in a C program can be placed
Answer: Both A and B
8. Which of the following is used for defining a macro?
Answer: #define
9. What is the notation that appears after the case statement?
Answer: :
10. Strings in C are
Answer: arrays of characters
11. The modifier used for carriage return is
Answer: r
12. The integer array exforsys declared as
int exforsys[30];
In the above array the thirtieth element is present in
Answer: exforsys[29]
13. What is the output of the following program?
main()
{
int exf=25;
int test;
test=++exf++;
printf("exf=%d test=%d",exf,test);
}
Answer: Gives Error
14. What is the output of the statement?
printf("Exforsys Training nis n Very Good");
Answer: Exforsys Training
is
Very Good
15. The goto statement mentioned as
goto exforsys;
would have the corresponding notation of label as
Answer: exforsys:
16. An array declared as
int exforsys[100];
The first element of the array is in
Answer: exforsys[0]
17. Which of the following denote special operators in C?
Answer: ,
18. What does the following C program results?
main()
{
int exforsys=100;
int test[exforsys];
for(j=1;j<=exfosys;j++)
{
scanf("%d",&exforsys[j]);
}
}
Answer: Gives Error
19. Which of the following is used for comparing two strings?
Answer: strcmp();
20. Which of the following areas is C language used?
Answer: All the Above
21. How is a structure variable named as test declared for a structure named as typedef struct exforsys?
Answer: struct exforsys test;
22. The default return value if omitted in a C function is
Answer: int
23. What value is returned by following C statement?
strcmp("EXFORSYS", "EXFORSYS");
Answer: Zero
24. Which of the following deals with single character?
Answer: Both A and B
25. Which of the following denote primary data types in C program?
Answer: All the Above
26. Which of the following are components of command line arguments?
Answer: Both A and B

Incorrect Questions (4 / 30)
1. Which of the following operating system was C originally developed?
Answer: UNIX
2. Which of the following denotes a new line character in C program?
Answer: n
3. The NULL in C is equal to
Answer: None of the Above
4. If a string literal in an initializer contains less character than the array has elements, the remaining elements are set to
Answer: 0

No comments:

Post a Comment