What's new
  • Welcome to PHCorner Forums. Take a moment to Sign up and gain unlimited access and extra privileges that guests are not entitled to, such as: All that and more! Registration is quick, simple and absolutely free. Join our community today!

Help Help po sa coding ng dev c

marshmalllow

Eternal Poster
Joined
Nov 30, 2016
Messages
1,152
Reaction
1,030
Age
26
pa help po sana ako mga master bayaran ko na lang po kayo ng load salamat
 

marshmalllow

Eternal Poster
1584150625903.png
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
 
Comment

Arcturus

Forum Guru
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.png
 
Comment

Like us on facebook

Online statistics

Members online
1,519
Guests online
1,486
Total visitors
3,005

Forum statistics

Threads
763,605
Messages
15,118,765
Members
1,408,349
Top