I think i know how to do it now,
i just initialise the value of a to a nnumber,
and then put it in the if statement, so that if a is inputed then a will be the initialise value as well.
And thanks anyways
User Profile
Collapse
-
Need help with scanf
I try to write a program that identify amounts of sale, and i also need to show an error message when a character is entered;
so i try the following:
...Code:#include <stdio.h> int main(int argc, char **argv){ int sale1, sale2; char c1; printf("Amount of Sale (inclusive of GST):"); scanf("%d.%d", &sale1, &sale2); scanf("%c",
No activity results to display
Show More
Leave a comment: