1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Turbo C++ Help! Plzz

Discussion in 'Programming' started by Abdul wahab, Sep 11, 2008.

  1. #1
    Hi Guys and Galz!

    I want to make software in C++ which take the two values (input) from the user and tell us in the result that which value is greater using "if" Function.

    Plzz help Me
     
    Abdul wahab, Sep 11, 2008 IP
  2. gramyla

    gramyla Peon

    Messages:
    71
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    What's the problem exactly in that i think you just have to compare between two variables only.
     
    gramyla, Sep 12, 2008 IP
  3. QiSoftware

    QiSoftware Well-Known Member

    Messages:
    805
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    158
    #3
    this sounds like homework?

    Q...
     
    QiSoftware, Sep 12, 2008 IP
  4. seoalan

    seoalan Peon

    Messages:
    71
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    is this your assignment?
     
    seoalan, Sep 12, 2008 IP
  5. Rukna

    Rukna Peon

    Messages:
    80
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    int a,b;
    scanf("%d%d",&a,&b);
    printf(a>b?"a is greater":"b is greater");
    but try to do yourself..........
     
    Rukna, Sep 12, 2008 IP
  6. Logitechie

    Logitechie Peon

    Messages:
    13
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Break it down for him, this is clearly a beginner C++ homework question.

    Create 2 variables for the 2 values the user inputs.
    Ask user to input first value, set 1st var = the input.
    Ask user to input second value, set 2nd var = the input.

    Then simply:

    If the 1stvar is greater then 2nd
    cout "1stvar is bigger"

    if the 2nd var is greater then 1st
    cout "2ns var is bigger"

    if the 1st = 2nd
    cout "they are equal"
     
    Logitechie, Sep 14, 2008 IP
  7. ammoun

    ammoun Active Member

    Messages:
    983
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    60
    #7
    Abdul Wahab, is it OK?

    You should say thanks ;)
     
    ammoun, Sep 17, 2008 IP