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

Trending Topics

Online now

Members online
460
Guests online
1,859
Total visitors
2,319

Forum statistics

Threads
2,294,209
Posts
29,089,427
Members
1,208,175
Latest member
yolli
Back
Top