All in C language...
Write a complete program that
Besides the numbers, nothing else should be written to standard output except for spaces separating the values.
I got this... and it's wrong
#include<stdio.h>
int main()
{
int num;
scanf("%d", &num);
printf("%d %d %d",num,2*num,num*num);
return 0;
}
#include <stdio.h>
int main()
{
int number;
printf("Enter a number : ");
scanf("%d",&number); // reads a value from keyboard
printf("%d",number); // the variable's value
printf(" %d",2*number); //twice the value & a space
before %d
printf(" %d",number*number); // the square of the value & a
space before %d
return 0;
}
Get Answers For Free
Most questions answered within 1 hours.