🔒 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
  • 378
    Views
  • 3
    Participants
Last reply from:
ak_gld

Trending Topics

Online now

Members online
1,066
Guests online
3,510
Total visitors
4,576

Forum statistics

Threads
2,307,232
Posts
29,177,549
Members
1,193,311
Latest member
MichaelRaquel
Back
Top