can someone help me with this code for c++ | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

can someone help me with this code for c++

A variable like userNum can store a value like an integer. Extend the given program as indicated. Output the user's input. (2 pts) Output the input squared and cubed. Hint: Compute squared as userNum * userNum. (2 pts) Get a second user input into userNum2, and output the sum and product. (1 pt) Enter integer: 4 You entered: 4 4 squared is 16 And 4 cubed is 64!! Enter another integer: 5 4 + 5 is 9 4 * 5 is 20

26th Aug 2020, 7:01 PM
Manesh Divedia
Manesh Divedia - avatar
7 Answers
+ 1
thank you I appreciate it!!
26th Aug 2020, 11:12 PM
Manesh Divedia
Manesh Divedia - avatar
0
so how would the statement look printf(("%d" + " + " + "%d" + " is " , (userNum + userNum2));
26th Aug 2020, 9:29 PM
Manesh Divedia
Manesh Divedia - avatar
26th Aug 2020, 9:40 PM
Edward Finkelstein
Edward Finkelstein - avatar
0
printf(("%d" + " + " + "%d" + " is " , ((userNum + userNum2)); like that
26th Aug 2020, 10:03 PM
Manesh Divedia
Manesh Divedia - avatar
0
edward for the code when i run it in my program I still get errors
26th Aug 2020, 10:13 PM
Manesh Divedia
Manesh Divedia - avatar
0
i updated it so that it uses printf and scanf
26th Aug 2020, 10:13 PM
Edward Finkelstein
Edward Finkelstein - avatar
0
you have to run it in separate compiler. i put link in my code. copy and paste it into that compiler.
26th Aug 2020, 10:16 PM
Edward Finkelstein
Edward Finkelstein - avatar