When I finish coding my source file and compile it and no problem with that...when I choose run it open the Dos windows and closes in a fraction of a second as if it flashes once...how can i fix this prob?
Printable View
When I finish coding my source file and compile it and no problem with that...when I choose run it open the Dos windows and closes in a fraction of a second as if it flashes once...how can i fix this prob?
Ok it worked but some similar problem got in the way after i enter the number that the program requires the window closes....exactly after i press enter
Code:#include<stdio.h>
int main()
{
int number;
printf("enter the number\n", number);
scanf("%d", &number);
number=number+1;
printf("the new number is %d", number);
return 0;
}
Obviously, the window is going to shut as soon as the program finishes, read the FAQ that Tonto posted carefully.
when i try running the prog from CMD it opens dev.
Ok im shouting now. READ ON THE LINK ABOVE !! :D
This is a very simple problem just read on the link tonto gave to you.
peace :)
i did man and still after i enter the number and press enter it shutsdown and when i open from CMD from the beginning of all it opens dev.
> when i open from CMD from the beginning of all it opens dev.
Try running the executable program (prog.exe), not the source code (prog.cpp)
it worked finally...thanks guys