🔒 Closed Help po sa coding ng dev c

Status
Not open for further replies.
1584150033044.webp

eto boss
 
1584150625903.webp

dapat po kase lalabas agad yung robie roboy is at origin 0,0 kapag nag enter po ako ng 1 kaso hindi po lumabas ..
sa pangalawang enter ko po ng 1 doon po lumabas yung robie roboy is at origin 0,0 hindi ko po alam kung ano pong mali sa code
 
eto ts makikitry,
C++:
#include<iostream>
int main(int argc, char * argv[]) {
    int b = 0, 
        org = 0, 
        x = 0,
        y = 0,
        h1 = 0,
        j1 = 0;
        
    while(b != 4){
        printf("Robbie\nChoices: \n");
        printf("1. Origin\n");
        printf("2. Move\n");
        printf("3. Status\n");
        printf("4. Quit\n");
        scanf("%d", &b);
        
        if(b == 1) {
            ++org;
            if(org >= 1)
                printf("Robbie Roboy is at    Origin %d, %d \n" , h1, j1);
        }
        
        else if(b == 2){
            printf("Enter x: ");
            scanf("%d", &x);
            printf("Enter y: ");
            scanf("%d", &y);
            h1 += x;
            j1 += y;
        }
        else if(b == 3){
                printf("Robbie Roboy is at    Origin %d, %d \n" , h1, j1);
        }
    }
}
1584188493402.webp
 
Status
Not open for further replies.

About this Thread

  • 12
    Replies
  • 784
    Views
  • 5
    Participants
Last reply from:
num143

Online now

Members online
439
Guests online
766
Total visitors
1,205

Forum statistics

Threads
2,276,049
Posts
28,967,271
Members
1,232,080
Latest member
forsakien
Back
Top