Ans-1)Minicomputer Mainframe computer Non-Impact printer ...

tongueborborygmusElectronics - Devices

Nov 7, 2013 (3 years and 9 months ago)

75 views

Ans
-
1)Minicomputer

Mainframe computer

Non
-
Impact printer,sprayed ink

Non
-
Impact printer,electrically charged ink

Ans
-
2)Done in class

Ans
-
3)Done in class

Ans
-
4)valid identifier
-
> ROLLNO , _basic, emp.id, good_work,

Invalid
-
> 2013oct, Total
salary, good
-
day, Indian#rupee , int

Ans
-
5)

a=5,b=3

b=++a + a++ +
--
b;


b=
--
b +
--
a * b++;


when prefix ++ or


is used in expression,then the variable is

increment
ed

/decrement
ed by one first and then expression is evaluated us
ing

the

new

va
lue
of variable

when postfix ++ or


is used in expression the expression is evaluated first using
original value of variable,
.After that increment /decrement of variable
by one
is
done

b=6+6+2

b=1
4 till now a=6 b=14

now fir
st a is incremented a=7

b=
1
3

+
6 *13

b=91

now b is incremented b=92


final : a=6, b=92

b)final a=24 b=5

a=3,b=5

check precedence table

d=a*=
-
a+b<<b+3

d=a*=
-
3+5<<b
-
3

d=a*=2<<b
-
3

d=a*=2<<5
-
3

d=a*=2<<2

d=a*=8 it is same as d=(a=a*8)

d=(a=3*8)

d=24

now b is post decremented so first bis printed as such

so
b=5

answer: 24 5


c)
final: avg=7

avg=10.7 +5 +2

avg=17.7

now typecasting is done avg is int , so avg =17

size of(avg)=2 (in turbo c,as int=2 bytes)

now size of(av
g)+5=2+5=
7