Answer to Question #17533 in C++ for ivan
write a program in C which prompts the user to enter an integer,then calculates it's square and displays the integer with the square on the screen
1
2012-10-30T11:31:28-0400
#include <stdio.h>
using namespace std;
int main ()
{
intinteger;
printf("Enter an integer, please: ");
scanf("%d",&integer);
intsquare = integer*integer;
printf("
Square of %d = %d
" , integer, square);
return0;
}
Need a fast expert's response?
Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!
Learn more about our help with Assignments:
C++
Comments
Leave a comment