Home » Newcomers » Newcomers » executions is going in reverce...
executions is going in reverce... [message #1453306] |
Sun, 26 October 2014 19:35 |
Lazy Shetty Messages: 3 Registered: October 2014 |
Junior Member |
|
|
Hi,
I'm a newcomer, i have installed the eclipse 4.4.1 very recently.
i'm trying a simple program where i'm trying to scan some values for some variables, but when i tried to compile, it first scans the values and then prints the message.
below is a copy of the code,
#include<stdio.h>
int x,y;
float m,n;
char a,b;
int main()
{
printf("\nBEGIN\n");
printf("\n enter value for INT x,y\n");
scanf("%d,%d",&x,&y);
puts("\nenter value for FLOAT m,n\n");
scanf("%f,%f",&m,&n);
printf("\nenter value for char a,b\n");
scanf("%c,%c",&a,&b);
return 0;
}
Output:
10,20
25.6,22.4
x,y
BEGIN
enter value for INT x,y
enter value for FLOAT m,n
enter value for char a,b
==================================
earlier when i installed cdt, i was not able to find the mingw toolchain, later from help files i realized i had to download it seperatly, and i downloaded it form "www.equation.com" and installed it. and i have made settings as mentioned in this video over Youtube "www.youtube.com/watch?v=KfKvDIrabUw". after that i'm able to perform c operations but when i tried to compile with the aabove code, it was performing in reverce. but if i comment the scanf, it performs correctly.
please help me with this issue.
thanks in advance.
|
|
| |
Goto Forum:
Current Time: Thu Apr 25 05:19:04 GMT 2024
Powered by FUDForum. Page generated in 0.08368 seconds
|