Quantcast
Viewing all articles
Browse latest Browse all 42307

Weird error?

Hi guys! So, I'm trying to write a program that gets the GCD of two numbers (I know, it's real easy, but I'm just doing this as a refresher), and I've finished writing the code, got it to compile and run, but when I ran it, the output is so whacked up that I don't really know what just happened:

Image may be NSFW.
Clik here to view.
Name:  01.png
Views: 38
Size:  9.4 KB


Code:

#include<stdio.h>
#include<conio.h>
main()
{
int a,b,rem;
clrscr();
printf("A:");
scanf("%d",a);
printf("B:");
scanf("%d",b);
rem=a % b;
        while(rem!=0){
          a=b;
          b=rem;
          rem=a%b;
          printf("%d\n",rem);
        }
printf("GCD:%d",rem);
getch();
}

Do you think it has something to do with the hardware/OS? I'm using Win7 x64, and as far as I can remember, the OS is not compatible with 16-bit applications.
Attached Images
Image may be NSFW.
Clik here to view.
 

Viewing all articles
Browse latest Browse all 42307

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>