Write a complete program that declares an integer variable r

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.

Solution

#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:

 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 v

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site