Professional Documents
Culture Documents
Solution: Letusc by Yashvantkenetkar
Solution: Letusc by Yashvantkenetkar
Solution: Letusc by Yashvantkenetkar
by yashvantkenetkar
solution
chapter 1
[A]
[C]
(A).
g=big/2+big*4/big-big+abc/3;
(abc = 2.5,big = 2,assume g to be a float)
g=2/2+2*4/2-2+2.5/3;
step:1
* & / operator will apply first( according to airthmatic operator priority) then + & -
g=1+2*4/2-2+0.8;
step:2
division & multiplicity both have equal priority but by left associativity * should be preferred first.
g=1+4-2+0.8;
g=3.8;
(B).
on=ink*act/2+3/2*act+2+tig;
(ink=4,act=1,tig=3.2,assume on to be an int)
on=4*1/2+3/2+1+3.2;
step1:
* & / should be preferred first then + & -(according to aithmatic operation priority
on=2+1.5+1+3.2;
on=7.7;
but on is integer variable so its value = 7
(c).
s=qui * add / 4 – 6 / 2 + 2 / 3 * 6 / god
(qui = 4,add = 2,god = 2,assume s to be an int)
s=4 * 2 /4 – 6 / 2 + 2 / 3 * 6 / 2;
step 1:
* & / operation should preferred first than + & -(according airthmatic operation priority) but if * & /
both have same priority so from left associativity * should be preferred first.
S=8/4-6/2+0*6/2;
s=2-3;
so, s=-1;
(D).
s= 1 / 3 * a / 4 - 6 / 2 + 2 / 3 * 6 / g ;
(a=4,g=3,assume s to be an int)
s= 1 / 3 * 4 / 4 – 6 / 2 + 2 / 3 * 6 / 3 ;
s=0*4/4–3+0*6/3;
s= - 3;
[D]
(A).
g=10/5/2/1;
g=2/2/1;
g=1/1;
g=1;
(B).
b=3/2+5*4/3;
b=1+5*4/3;
b=1+20/3;
b=1+6;
b=7;
(C).
a=b=c=3+4;
a=b=c=7;
[E]
(a).
ans:- z= (8.8 * (a+b) * 2 / c – 0.5 + 2 * a / (q+r))/((a+b)*(1/m))
(b).
ans:- x=(-b+(b*b)+2*4*a*c)/(2*c)
(c).
ans:- R=(2*v+6.22*(c+d))/(g+v)
(d).
ans:-A=(7.7*b*(x*y+a)/c-0.8+2*b)/((x+a)*(1/y))
[F]
(a).
output:
0 2 0.00000 2.000000
(b).
output:
0 -6
(c).
output:
1
(d).
output:
nn
nn
nn /n/n nn/n
(e).
output:
a b
(f).
output:
p q
[G]
answers
(a). (2) Dennis Ritchir
(k). (4) / or * , - or +
(m). (3) ( )
(p). (4) 0
(r). (2) 6
(y). (4) * / + -
(a).
(b).
(c).
(d).
(e).
(f).
(g).
(h).
(i)
(j).
#include<stdio.h>
void main()
{
int a=80000,b,c,d,e,f,g;
b=(a*52)/100;
c=(a*48)/100;
d=(a*35)/100;
e=(a*13)/100;
f=b-d;
g=c-e;
printf("total no. of illiterate men=%d\n",f);
printf("total no. of illiterate women=%d\n",g);
}
(k).
}
else
{
printf("Entered no. is not in the order of 100\n");
}
}
(l).
(m).
thanks......................