- #1
Dr.Brain
- 538
- 2
I am a newbie to C and i am learning it all by myself without any teacher.
Ok i wrote this programme in my notepad and saved it as dd.c on my desktop:
#include <stdio.h>
int main()
{
int a, b, c;
a = 5;
b = 7;
c = a + b;
printf("%d + %d = %d\n", a, b, c);
return 0;
}
Please tell me if there is a flaw in my coding . I downloaded a free C-compiler , and wanted to convert my .c to .exe , executable file .
So what I did was that I opened my .c file with this compiler and then saved it agains as dd.exe on my desktop , but when i opened the .exe by clicking on it , it displays a series of programmes and tells me to choose the most apt programme out of all those.So how do i run my programme. Through my code, I want that the output on my screen displays 5+7=12 . Should I go to DOS for execution or what? and how do I reach DOS from XP?
BJ
Ok i wrote this programme in my notepad and saved it as dd.c on my desktop:
#include <stdio.h>
int main()
{
int a, b, c;
a = 5;
b = 7;
c = a + b;
printf("%d + %d = %d\n", a, b, c);
return 0;
}
Please tell me if there is a flaw in my coding . I downloaded a free C-compiler , and wanted to convert my .c to .exe , executable file .
So what I did was that I opened my .c file with this compiler and then saved it agains as dd.exe on my desktop , but when i opened the .exe by clicking on it , it displays a series of programmes and tells me to choose the most apt programme out of all those.So how do i run my programme. Through my code, I want that the output on my screen displays 5+7=12 . Should I go to DOS for execution or what? and how do I reach DOS from XP?
BJ