C Program find Output code snippet SET - 11
|
.
|
FILE is a structure
suitably typedef'd in "stdio.h".
|
|||||||
Workspace
|
2.
|
We want to round off x, a float, to an int value,
The correct way to do is
|
|||||||||||||||
Workspace
|
3.
|
The binary equivalent of 5.375 is
|
|||||||||||||||
Workspace
|
4.
|
What will you do to treat the constant 3.14 as a float?
|
|||||||||||||||
Workspace
|
5.
|
Every operator has an Associativity
|
|||||||
Workspace
|
6.
|
What will be the output of the program if the array begins at address
65486?
#include<stdio.h>
int main()
{
int arr[] =
{12, 14, 15, 23, 45};
printf("%u,
%u\n", arr, &arr);
return 0;
}
|
|||||||||||||||
Workspace
|
7.
|
Range of double is -1.7e-38 to 1.7e+38 (in 16 bit
platform - Turbo C under DOS)
|
|||||||
Workspace
|
8.
|
The macro va_arg is used to extract an argument from
the variable argument list and advance the pointer to the next argument.
|
|||||||
Workspace
|
9.
|
What will be the output of the program?
#include<stdio.h>
int get();
int main()
{
const int x =
get();
printf("%d",
x);
return 0;
}
int get()
{
return 20;
}
|
|||||||||||||||
Workspace
|
10.
|
What will be the output of the program (myprog.c) given below if it is
executed from the command line?
cmd> myprog one two three
/* myprog.c */
#include<stdio.h>
#include<stdlib.h>
int main(int argc, char **argv)
{
int i;
for(i=1;
i<=3; i++)
printf("%u\n", &argv[i]);
return 0;
}
If the first value printed by the above program is 65517, what will be
the rest of output?
|
|||||||||||||||
Workspace
|
11.
|
The macro va_arg is used to extract an argument from
the fixed micro argument list and advance the pointer to the next argument.
|
|||||||
Workspace
|
12.
|
A preprocessor directive is a message from compiler to a linker.
|
|||||||
Workspace
|
13.
|
In a macro call the control is passed to the macro.
|
|||||||
Workspace
|
14.
|
What will be the output of the program ?
#include<stdio.h>
#include<string.h>
int main()
{
printf("%d\n",
strlen("123456"));
return 0;
}
|
|||||||||||||||
Workspace
|
15.
|
Point out the error in the program?
#include<stdio.h>
int main()
{
unsigned int a, b,
c, d, e, f;
a=b=c=d=e=f=32;
a<<=2;
b>>=2;
c^=2;
d|=2;
e&=2;
f~=2;
printf("%x
%x %x %x %x %x\n", a, b, c, d, e, f);
return 0;
}
|
|||||||||||||||
Workspace
|
16.
|
Can a structure can point to itself?
|
|||||||
Workspace
|
17.
|
What will be the output of the program?
#include<stdio.h>
int main()
{
int i;
i =
printf("How r u\n");
i =
printf("%d\n", i);
printf("%d\n",
i);
return 0;
}
|
|||||||||||||||
Workspace
|
18.
|
What will be the output of the program?
#include<stdio.h>
int main()
{
float a=0.7;
if(a
< 0.7)
printf("C\n");
else
printf("C++\n");
return 0;
}
|
|||||||||||||||
Workspace
|
19.
|
What will be the output of the program?
#include<stdio.h>
int main()
{
int k,
num=30;
k =
(num>5 ? (num
<=10 ? 100 : 200): 500);
printf("%d\n",
num);
return 0;
}
|
|||||||||||||||
|
Provide your Output in Comments. We will publish the output soon.
Comments
Post a Comment