738 views
3 votes
Write a complete program thatdeclares an integer variable,reads a value from the keyboard into that variable, andwrites to standard output the square of the variable's value.besides the number, nothing else should be written to standard output.

User LacOniC
by
8.3k points

1 Answer

3 votes
#include

int main()
{
int num;
scanf("%d", &num);
printf("%d", num*num);
return 0;
}
User Pqvst
by
7.8k points
Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.

9.4m questions

12.2m answers

Categories