Saturday, 1 August 2015
Learn C language-Tutorial 1: How to run a C program
By
Narendiranath
Hai, this tutorial will teach you how to run a c program, although you don’t have much knowledge about it.
Let me something tell about C. C program is a high level language developed by Dennis Ritchie in the year 1972.
The C program is written in high level language and it cannot be directly understand by the system, so a compiler(converts high level language to machine level language) is needed.
I prefer Turbo c++ compiler in which we can compile both c and c++ programs.
Let we start our coding…..
In order to program we need a compiler so download Turbo c++ software
Click the Download
If you have Internet Download Manager click Start Download otherwise it will be normally downloaded in the web browser.
Then Install the Turbo c++
Click The Install
Then Installing will be started
After the installation completed the Turbo c++ compiler will be opened with a pre-defined graphic program.
[Note: press ALT+Enter to make the compiler minimize and maximize.]
Then go to FILE click new
So after the new screen is opened save it as filename.c
For example demo.c and click OK
SO type the following simple C program to print “This is my first c program” in the output screen
After typing the program save it again, we have to compile the program, to compile click the Compile option or you can use the short cut key Alt+F9
Then it checks for any error and it will display the number of errors and warnings. If the program is right it will show the error and warnings as 0.
Then it is time to run the program and get the output.
Then the output will be displayed
Yahooooooooooo……..
we have successfully got the output.
Thus the simple program in C is implemented successfully.
SOME BASIC TIPS FOR C PROGRAMMING
Narendiranath
Hai, this tutorial will teach you how to run a c program, although you don’t have much knowledge about it.
Let me something tell about C. C program is a high level language developed by Dennis Ritchie in the year 1972.
Developed at AT&T bell laboratory
The C program is written in high level language and it cannot be directly understand by the system, so a compiler(converts high level language to machine level language) is needed.
I prefer Turbo c++ compiler in which we can compile both c and c++ programs.
Let we start our coding…..
In order to program we need a compiler so download Turbo c++ software
Click the Download
If you have Internet Download Manager click Start Download otherwise it will be normally downloaded in the web browser.
Then Install the Turbo c++
Click The Install
Then Installing will be started
After the installation completed the Turbo c++ compiler will be opened with a pre-defined graphic program.
[Note: press ALT+Enter to make the compiler minimize and maximize.]
Then go to FILE click new
So after the new screen is opened save it as filename.c
For example demo.c and click OK
SO type the following simple C program to print “This is my first c program” in the output screen
#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
printf(“this is my first c program”);
getch();
}
After typing the program save it again, we have to compile the program, to compile click the Compile option or you can use the short cut key Alt+F9
Then it checks for any error and it will display the number of errors and warnings. If the program is right it will show the error and warnings as 0.
Then it is time to run the program and get the output.
Then the output will be displayed
Yahooooooooooo……..
we have successfully got the output.
Thus the simple program in C is implemented successfully.
SOME BASIC TIPS FOR C PROGRAMMING
- Each instructions in a c program is written as a separate statement.Therefore, a complete C program would comprise a series of statements.
- The statements in a program must appear in the same order in which we wish them to be executed.
- Blank statement may be inserted to improve the readability of the statement, but no blank spaces are allowed between variables.
- All statements are written in small letters.
- C has no specific rules for the position at which a statement is to be written, that's why it is also called as free-form language.
- Every statement must end with a ' ; ' , the semi-colon is used as statement terminator.
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment