What's new

Help Sa mga Comsci or IT patulong po C++

ak_gld

Eternal Poster
Established
Joined
Dec 12, 2015
Posts
466
Solutions
1
Reaction
75
Points
354
Write a code fragment that tests the value of an integer num. If the value of num is 10, square num. If it is 9, read a new value into num. If it is 2 or 3, multiply num by 99 and print out the result. Implement your code using swtich.
medyo lito lng po
 
Steps:

Declare an Integer variable num1.

Read value of variable num1,

if num1 is 9 then again read a new value into num1,

if num1 is 10 then square it.

if num1 is 2 or 3 multiply it by 99.

at the end display the value of num1
 
[XX='Jlc31Louie, c: 649951, m: 431711'][/XX] ikaw nabahala mag sulat ng code paps..kaya mo nayan :)
 
Steps:

Declare an Integer variable num1.

Read value of variable num1,

if num1 is 9 then again read a new value into num1,

if num1 is 10 then square it.

if num1 is 2 or 3 multiply it by 99.

at the end display the value of num1
wow, nice paps
 

Similar threads

Back
Top