Answer to Question #17533 in C++ for ivan

Question #17533
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
Expert's answer
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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS