🔒 Closed Sa mga Comsci or IT patulong po C++

Status
Not open for further replies.

ak_gld

Eternal Poster
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
 
Status
Not open for further replies.

About this Thread

  • 5
    Replies
  • 365
    Views
  • 3
    Participants
Last reply from:
ak_gld

Online now

Members online
1,107
Guests online
906
Total visitors
2,013

Forum statistics

Threads
2,277,021
Posts
28,973,765
Members
1,229,687
Latest member
gsby1440xd
Back
Top