Write a complete program that declares an integer variable, reads a value from t
ID: 3793727 • Letter: W
Question
Write a complete program that declares an integer variable, reads a value from the keyboard into that variable, and writes to standard output the variable's value, twice the value, and the square of the value, separated by spaces. Besides the numbers, nothing else should be written to standard output except for spaces separating the values Do this exercise after doing the others that are due on the same date. The others will help you to figure out how to do this one. Especially, do this one after exercise 10014.Explanation / Answer
#include <stdio.h>
int main(void)
{
int num;
printf("Enter the value of integer number : ");
scanf("%d",&num);
printf(" %d %d %d",num,2*num,num*num); //num,2*num and num*num will be displayed
return 0;
}
output:
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.