HFCL PP
HFCL PP
int a=1.1
float b=1.1
if (a==b)
{
printf(both are same)
}
else
{
printf(both are different)
}
main()
{
int i;
float *pf;
pf = (float *)&i;
*pf = 100.00;
printf( %d, i);
}
a) Runtime error.
b) 100
c) Some Integer not 100
d) None of the above
ANS: d
main()
{
printf(Jumboree);
main();
}
Q4. A batsman scores 23 runs and increases his average from 15 to 16. Find the
runs to be made if he wants top inc the average to 18 in the same match.
ANS: 39 runs.
Q5. A rich merchant had collected many gold coins. He did not want anybody to
know about them. One day, his wife asked, how many gold coins do we have?
After pausing a moment, he replied, Well! If I divide the coins into two unequal
numbers, then 37 times the difference between the two numbers equals the
difference between the squares of the two numbers. The wife looked puzzled. Can
you help the merchants wife by finding out how many gold coins they have?
ANS: 37 coins.
main()
{
char *str;
str=char*malloc(20*sizeof(char));
strcpy(str,test);
strcat(str,,!,);
printf(%s,str);
}
main()
{char*a,*f();
a=char*malloc(20*sizeof(char));
a=f();
printf(%s,a);
}
char *f()
{char n[20];
strcpy(n,Hello World);
return(n);
}
int i =10
main()
{int i =20,n;
for(n=0;n<=i;)
{int i=10;
i++;
}
printf(%d, i);
ANS: i=20
Q9. Jhaveri invested in Upendra & Upendra, Celco and Winger shares at Rs.
300,Rs.200 and Rs.5 per share respectively. He bought 100 shares for
Rs.1000.The number of Upendra & Upendra and Celco shares he bought are
respectively:
a) 23,17
b) 17,23
c) 17,60
d) 15,25
ANS: b)17,23
Q10. Which statement is true about main?
Q11. A cone and a sphere have the same radius and in the cone we put the
sphere. Then how much of sphere will be inside the cone?
a) 1/2
b) >1/2
c) <1/2
d) 1/4
ANS: d)1/4
#include
#include
void main()
{
int i=1*4/3-27%3^2+100*0.5-(4>3?1:2);
clrscr();
printf(%d,i);
getch();
}
a) 49
b) compile error
c) 51
d) 48
ANS: b