Use a temporary variable :
Code:
#include <stdio.h>
int main(void)
{
int number_1, temp;
printf("Input a number: \n");
scanf("%d", &number_1);
temp = number_1 * 3;
printf("The # you entered times 3 = %d\n", temp);
temp = number_1 / 2;
printf("The # you entered divided by 2 = %d\n", temp);
return 0;
}
or just print the value that you want printed,
Code:
#include <stdio.h>
int main(void)
{
int number_1;
printf("Input a number: \n");
scanf("%d", &number_1); //Note the '&'
printf("The # you entered times 3 = %d\n", number * 3);
printf("The # you entered divided by 2 = %d\n", number / 2);
return 0;
}
You have to pass the memory location (the address) of the data to scanf(). The ampersand, '&', indicates an address.
Also, return 0 at the end of main.