need help using c

cpp India
  • 12 years ago
    how do i convert this soit works on a linux and mac system? please help. #include stdio.h
    #include math.h
    #include conio.h
    #include stdlib.h
    int main()
    {
    int c;
    int a, b;
    char d;
    pov:system("cls");
    printf("Enter the first number\n");
    a=getch()-48;
    system("cls");
    printf("Enter the function:\n");
    d=getch();
    system("cls");
    printf("Enter the second number\n");
    b=getch()-48;
    system("cls");
    while (0==0)
    {
    if (d=='*')
    {
    a=a*b;
    }
    if (d=='/')
    {
    a=a/b;
    }
    if (d=='+')
    {
    a=a+b;
    }
    if (d=='-')
    {
    a=a-b;
    }
    printf("value is %d \n",a);
    printf("Press 'q' to quit, or press other key to repeat data input\n");
    c=getch();
    if((c=='q')||(c=='Q')) return;
    goto pov;
    }
    }

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Engineers are all basically high-functioning autistics who have no idea how normal people do stuff.” - Cory Doctorow