Thursday, August 09, 2012

Operators

Write down all the questions using Operators that is (Arithmetic, Relational and Logical Operators).
Arithmetic Operators are:
* / % + -
Relational Operators are:
==,  >,  <,  !=,  >=,  <=.
Logical Operators are:
AND,  OR,  NOT

Solve all the previous exercises.

Best Of Luck.


12 comments:

shivam agggarwal said...

Accept the two numbers , divided the first number by the second number and display the quotient:
Begin
Numeric=nNum1, nNum2, nquotient
Display “Enter number1”
Accept nNum1
Display “Enter number2”
Accept nnum2
nquotient = nNum1/nNum2
Display “Equal to”
Display “nquotient”
End

Accept distance is kilometers convert it into meter and then display the result:
Begin
Numeric = nKilometer, nMeter,
Display “Enter distance in kilometer”
Accept nKilometer
nMeter = nKilometer*1000
Display “Equal to”
Display “nMeter”
End

Gateway To Information Technology said...

Good, But donot put "" on variables names when u r displaying only variables.

shivam agggarwal said...

Accept the two numbers , divided the first number by the second number and display the quotient:
Begin
Numeric=nNum1, nNum2, nquotient
Display “Enter number1”
Accept nNum1
Display “Enter number2”
Accept nnum2
nquotient = nNum1/nNum2
Display “Equal to”
Display nquotient
End

Accept distance is kilometers convert it into meter and then display the result:
Begin
Numeric = nKilometer, nMeter,
Display “Enter distance in kilometer”
Accept nKilometer
nMeter = nKilometer*1000
Display “Equal to”
Display nMeter
End

Unknown said...

Accept the two numbers , divided the first number by the second number and display the quotient:
Begin
Numeric=nNum1, nNum2, nquotient
Display “Enter number1”
Accept nNum1
Display “Enter number2”
Accept nnum2
nquotient = nNum1/nNum2
Display “Equal to”
Display nquotient
End

Accept distance is kilometers convert it into meter and then display the result:
Begin
Numeric = nKilometer, nMeter,
Display “Enter distance in kilometer”
Accept nKilometer
nMeter = nKilometer*1000
Display “Equal to”
Display nMeter
End

Unknown said...

arshdeep kaur
1.Pseudocode that accept distance in kilometers converts it into meters & display result
Sol: begin
numeric ndis,nresult
display'enter distance '
accept distance
nresult=ndistance*1000
display "distance in meters":+nresult
end
2.Pseudocode to accept item name,price & quantity & display item name & total value
total value can be calculated as product of price & quantity.
Sol: begin
numeric nprice,nquantity,npro
character citemname
display'enter itemname'
accept citemname
display'enter price'
accept nprice
display'enter quantity'
accept nquantity
npro=nprice*nquantity
display'itemname'
display'npro'
end
3.Pseudocode to accept of 5 subject .Calculate avg . If avg>85 print excellent
if avg>65<86 print good ,if avg>=50 and<66 print fair, if avg<50 print fail
Sol: begin
numeric num1,num2,num3,num4,num5,navg
display 'enter 5 numbers'
accepy num1,num2,num3,num4,num5
navg=(num1+num2+num3+num4+num5)/5
if(avg>85)
begin
display 'excellent'
end
else(avg>65 && avg<86)
begin
display 'good'
end
if(avg>=50 && avg<66)
begin
display 'fair'
end
else(avg<50)
begin
display 'fail'
end
end

shivam agggarwal said...


accept marks of 5 subject calculate the average , if the average is greater than 85 print excellent, if greater than 65 and less than 86 print good, if greater than and equal to 50 and less than 66 print fair, if less than 50 print fail
Begin
numeric= nNum1, nNum2, nNum3, nNum4, nNum5, nAvg, nSum
Display “enter number1”
Accept nNum1
Display “enter number2”
Accept nNum2
Display “enter number3”
Accept nNum3
Display “enter number4”
Accept nNum4
Display “enter number5”
Accept nNum5
nSum=nNum1+nNum2+nNum3+nNum4+nNum5
Display “equal to”
Display nSum
nAvg= nSum/5
Display “equal to”
Display nAvg
If
(nAvg>85)
Display excellent
Else
If (nAvg>65andnAvg<86)
Display good
Else
If (nAvg>50andnAvg<66)
Display fair
Else
If (nAvg>50)
Display fail
End




Unknown said...

Q1:- write the pseudocode to accept two numbers,divide the first number by the second and display their quotient?
Sol:-begin
Numeric nNum1,nNum2,Nquotient
Display”enter number 1”
Accept nNum1
Display”enter number 2”
Accept nNum2
Nquotient=nNum1/nNum2
Display”nquotient”
End

Q2:-write the pseudocode that accept in kilometers,converts it into meters and then display the result??
Sol:-begin
Numeric nkilometer,nmeter
Display”enter nkilometer”
Accept nkilometer
Nmeter=nkilometer*1000
Display nmeter
End
Q3:-Accept the marks of 5 subjects calculate the average,if the average greater than 85 print excellent,if the average is greater than 65 & less than 86 print good,if the average is greater than 50 & less than 66 print fair,if the average is less than 50 print fail?
Sol:-begin
Numeric nNum1,nNum2,nNum3,nNum4,nNum4,nNum5,nAvg,nsum
Display”enter number 1”
Accept nNum1
Display”enter number 2”
Accept nNum2
Display”enter number 3”
Accept nNum3
Display”enter number 4”
Accept nNum4
Display”enter number 5”
Accept nNum5
Nsum=nNum1+nNum2+nNum3+nNum4+nNum5
Display”equal to”
Display nsum
nAvg=nsum/5
display”equal to”
display nAvg
if(nAvg>85)
display excellent
else
if(nAvg>65 & nAvg<85)
display good
else
if(nAvg>50 & nAvg<66)
display fair
else
if(nAvg<50)
display fail
end

Unknown said...

1.Pseucode to accept marks of 5 subject. Calculate avg. If avg>65<86. print "good".If avg>50and<66 print "fair". If avg<50 print fail.

solll....
begin
numeric num1,num2,num3,num4,num5
display'enter 5 number'
accept num1,num2,num3,num4,num5
navg=(num1+num2+num3+num4+num5)/5
if(avg>85)
begin
display'excellent'
end
else(avg>65&&avg<86)
begin
display'good'
end
if(avg>=50&&avg<66)
begin
display'fair'
end
else(avg<50)
begin
display'fail'
end
end


2.Pseudocode that accept distance in kilometers converts it into meters & display result
Sol: begin
numeric ndis,nresult
display'enter distance '
accept distance
nresult=ndistance*1000
display "distance in meters":nresult
end

3.Pseudocode to accept item name,price & quantity & display item name & total value
total value can be calculated as product of price & quantity.
Sol: begin
numeric nprice,nquantity,npro
character citemname
display'enter itemname'
accept citemname
display'enter price'
accept nprice
display'enter quantity'
accept nquantity
npro=nprice*nquantity
display'itemname'
display'npro'
end

Unknown said...

accept marks of 5 subject calculate the average , if the average is greater than 85 print excellent, if greater than 65 and less than 86 print good, if greater than and equal to 50 and less than 66 print fair, if less than 50 print fail

sol
numeric= nNum1, nNum2, nNum3, nNum4, nNum5, nAvg, nSum
Display “enter number1”
Accept nNum1
Display “enter number2”
Accept nNum2
Display “enter number3”
Accept nNum3
Display “enter number4”
Accept nNum4
Display “enter number5”
Accept nNum5
nSum=nNum1+nNum2+nNum3+nNum4+nNum5
Display “equal to”
Display nSum
nAvg= nSum/5
Display “equal to”
Display nAvg
If
(nAvg>85)
Display excellent
Else
If (nAvg>65andnAvg<86)
Display good
Else
If (nAvg>50andnAvg<66)
Display fair
Else
If (nAvg>50)
Display fail
End

Unknown said...

Q1 write the pseudo code to accept two no, divide the first no by second no and display their quotient?
Sol: begin
Numeric n num1, n num2, n quotient
Display “enter no for quotient “
Display “enter n num 1”
Accept “n num 1”
Display “enter n num 2”
Accept “n num 2”
N quotient =n num1/n num2
Display quotient
End

Q2: write the pseudo code that accept in kilometers, converts it into meters and display the result
Sol: begin
Numeric n kilometers, n meters
Display” enter n kilometer”
Accept n kilometer
N meter = n kilometer*1000
Display n meter
End

Q3: accept the marks of five subjects. Calculate the average. if the average > 85 print excellent . if the average is >65 and < 86 print good . If the average is >50 and<66 print fair. If the average is <50 print fail.
Begin
Numeric nnum1, nnum2, nnum3, nnum4, nnum5
Display “enter no for average”
Display “enter number 1”
Accept nnum1
Display “enter number2”
Accept nnum2
Display “enter number 3”
Accept n num3
Display” enters number4”
Accept nnum4
Display “enter number5”
Accept n num5
If (average >85)
Begin
Display excellent
End
Begin
Else If (average>65&average<86)
Display good
End
Begin
Else if (average>50&average<66)
Display fair
End
Begin
Else if (average<50)
Display fail
End
End

Unknown said...

Q1 write the pseudo code to accept two no, divide the first no by second no and display their quotient?
Sol: begin
Numeric n num1, n num2, n quotient
Display “enter no for quotient “
Display “enter n num 1”
Accept “n num 1”
Display “enter n num 2”
Accept “n num 2”
N quotient =n num1/n num2
Display quotient
End

Q2: write the pseudo code that accept in kilometers, converts it into meters and display the result
Sol: begin
Numeric n kilometers, n meters
Display” enter n kilometer”
Accept n kilometer
N meter = n kilometer*1000
Display n meter
End

Q3: accept the marks of five subjects. Calculate the average. if the average > 85 print excellent . if the average is >65 and < 86 print good . If the average is >50 and<66 print fair. If the average is <50 print fail.
Begin
Numeric nnum1, nnum2, nnum3, nnum4, nnum5
Display “enter no for average”
Display “enter number 1”
Accept nnum1
Display “enter number2”
Accept nnum2
Display “enter number 3”
Accept n num3
Display” enters number4”
Accept nnum4
Display “enter number5”
Accept n num5
If (average >85)
Begin
Display excellent
End
Begin
Else If (average>65&average<86)
Display good
End
Begin
Else if (average>50&average<66)
Display fair
End
Begin
Else if (average<50)
Display fail
End
End




Unknown said...

Q1 write the pseudo code to accept two no, divide the first no by second no and display their quotient?
Sol: begin
Numeric nnum1, nnum2, n quotient
Display “enter no for quotient “
Display “enter nnum 1”
Accept “nnum 1”
Display “enter nnum 2”
Accept “nnum 2”
N quotient =n num1/n num2
Display quotient
End

Q2: write the pseudo code that accept in kilometers, converts it into meters and display the result
Sol: begin
Numeric nkilometer, nmeter
Display” enter nkilometer”
Accept nkilometer
N meter = nkilometer*1000
Display n meter
End

Q3: accept the marks of five subjects. Calculate the average. if the average > 85 print excellent . if the average is >65 and < 86 print good . If the average is >50 and<66 print fair. If the average is <50 print fail.
Begin
Numeric nnum1, nnum2, nnum3, nnum4, nnum5,total average
Display “enter no for average”
Display “enter number 1”
Accept nnum1
Display “enter number2”
Accept nnum2
Display “enter number 3”
Accept n num3
Display” enters number4”
Accept nnum4
Display “enter number5”
Accept n num5
Total Average=(nnum1+nnum2+nnum3+nnum4+nnum5)/5
If (average >85)
Begin
Display excellent
End
Begin
Else If (average>65&average<86)
Display good
End
Begin
Else if (average>50&average<66)
Display fair
End
Begin
Else if (average<50)
Display fail
End
End

Respected sir
the task which I have been submitted earlier needs some correction. so this is my new task which I have corrected