C Programming and Problem Solving
Questions 281 to 290
281.
|
Which of
the following is not a keyword in
C language?
|
||||||||||
282.
|
With
every use of a memory allocation function, what function should be used to
release allocated memory, which is no longer needed?
|
||||||||||
283.
|
Write the
first line of the function definition for the following:
“a
function called add accepts two integer arguments and returns a
floating point value”
|
||||||||||
284.
|
What is the
output of the following program?
#include<stdio.h>
int c[10]=[1,2,3,4,5,6,7,8,9,10];
main()
{
int a,b=0;
for(a=0;a<10;++a)
if(c[a]%2==1) b+=c[a];
printf(“%d”,b);
}
|
||||||||||
285.
|
Which of the
following is not valid where p1, p2 are pointers?
|
||||||||||
286.
|
How much
memory does the call malloc(10) allocate?
|
||||||||||
287.
|
How many
union members can be initialized?
|
||||||||||
288.
|
Describe the
following array
int s[5][6]
|
||||||||||
289.
|
What is the
output of the following statements?
for(i=10;i++;i<15)
printf(“%d”,i);
|
||||||||||
290.
|
What number
would be shown on the screen after the following statements of C code are
executed?
char ch;int
i;ch= ‘g’;i=ch-‘a’;
printf(“%d”,i);
|
Answers
281.
|
Answer : (d)
Reason: Get char is not a key word in c language.
|
282.
|
Answer : (e)
Reason: With every use of a memory allocation function, free() function should be used to
release allocated memory, which is no longer needed.
|
283.
|
Answer : (b)
Reason: Float add(int a, int b).
|
284.
|
Answer : (c)
Reason: The out put of the program is 25.
|
285.
|
Answer : (c)
Reason: *p1 + *p2 is not valid where p1,p2 are pointers.
|
286.
|
Answer : (a)
Reason: 10 bytes of memory will be allocated for the call malloc(10).
|
287.
|
Answer : (a)
Reason: Only one member of a union at
one time can be initialized.
|
288.
|
Answer : (b)
Reason: int s[5][6] means s is a two –dimensional 30 element array(5
rows,6 columns).
|
289.
|
Answer : (e)
Reason: No output.
|
290.
|
Answer : (a)
Reason: 6 would be shown on the screen
after the following statements of c are executed.
|
No comments :
Post a Comment