Dears
I use Dev C++ in compiling, want to write C. i found there is some error. when i rewrite them, i find it regard me as wrong in C.
Original code.
Code:
Main ()
{
int revenue;
int price;
int quantity;
printf(“Please input the price”)
scanf(“%d”, &price)
printf(“Please input the quantity”)
scanf(“%d”, &quantity)
revenue = price* quantity
printf(“Total revenue is”, &revenue)
}
Code as correct in Dev C++
Code:
# include <stdio.h>int Main ()
{
int revenue;
int price;
int quantity;
printf("Please input the price %c");
scanf("%d", &price);
printf("Please input the quantity %c");
scanf("%d", &quantity);
revenue = price*quantity;
printf("Total revenue is %c", &revenue);
}
PS I m newbie