User Profile

Collapse

Profile Sidebar

Collapse
alexanderkwok17
alexanderkwok17
Last Activity: Aug 3 '10, 11:42 PM
Joined: Aug 3 '10
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • alexanderkwok17
    replied to Need help with scanf
    in C
    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
    See more | Go to post

    Leave a comment:


  • alexanderkwok17
    started a topic Need help with scanf
    in C

    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",
    ...
    See more | Go to post
    Last edited by alexanderkwok17; Aug 3 '10, 11:37 AM. Reason: additional question
No activity results to display
Show More
Working...