Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
  • C issues with Xcode.

    • 0
    • 0
    • 0
    • 1
    • 0
    • 0
    • 0
    • 554
    Answer it

    Hello Guys/Gals,

    I went to a 4 day C programming course in which I learned using windows. Now I'm using Xcode on my own MAC. I'm trying to practice some of the things I learned but having some small issues with Xcode. I wrote this C program to prompt the user to input 3 integer values and print these values in forward and reversed order, this is my code: Can anyone see where I went wrong?



    int main()

    { int val1; int val2; int val3;

    printf("Please select three numbers.");
    scanf(" %d %d %d" ,&val1 ,&val2 ,&val3);
    printf(" Your numbers forward are:\n");
    printf("%d", &val1);printf("\n");
    printf("%d", &val2);printf("\n");
    printf("%d", &val3);printf("\n");
    printf("Your numbers in reverse are:\n");
    printf("%d" ,&val3);printf("\n");
    printf("%d" ,&val2);printf("\n");
    printf("%d" ,&val1);printf("\n");
       return 0;



    This was my output after entering 1,2,3 as my numbers:

    Please select three numbers. 1 2 3 Your numbers forward are: 1606416312 1606416308 1606416304 Your numbers in reverse are: 1606416304 1606416308 1606416312

 1 Answer(s)

Sign In

Sign up using

Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: