Hi Guest 1 HomePage 1 Jobs 1 WalkIn 1Articles  

 :) Latest Topic
Introduction to C
History of C Language
C Variables
Variables Types in C
C Identifiers
C Operators
C Comments
ASCII Value C
Constants C
Features of C
Install C Language
Start C Program
Compilation in c
printf() and scanf()
C Data Types
C Keyword
Format Specifier C
Format Specifier part2
Escape Sequence C
Tokens in C
Boolean in C
What are literals?
 


  

 
Start C Program
Question Posted on 12 Aug 2020

Home >> Tutorial >> C Language >> Start C Program


Start C Program
Before going hard on program and logic i have created a simple program and provide details how to compile and run the first C program. To write our first program we need to open the C console and write the below code:-


First C Program
Now i will explain above code line by line. In above code first line is #include < stdio.h> . This will includes the standard input output library functions. And there are lots of other includes files which we will be used later on. And printf() function is defined in stdio.h which we have used in above 3rd line.

Now comes to 2nd line which is function int main() here int is return type means it will return the integer values in above program we use "return 0" which means this will return 0. And now main() it is the main entry point of every program in C language.

Now 3rd line which i have allready explain it is used to print data on the console here in above program it will print "Hello C" on the console.

Now 4th line i have allready define it is used to return some values and here 0 value is used for successful execution and 1 for unsucessful execution. It is also known as the status to OS.

Now comes to compile and run the C Program>
We have 2 ways to compile and run c program one by the menu and another one is by shortcut
(1)Click on the compile menu then compile sub menu to compile c program. After that click on run menu then run sub menu to run aprogram in C.
(2)Second method is to clock Ctrl+F9 to both compile and run the program directly.

And below is the output screen for the above program



Run C Program

key Ctrl+F5 is also used to view the screen any time.





Other Important Questions
Features of C
Introduction to C
History of C Language
Install C Language
C Variables







 
Top Searches:asp net questions vb net questions sql query uddl questions class javascript Questions sharepoint interview questions and concept silverlight questions and concept wcf questions beans general knowledge ajax questions
PHP | Biztalk | Testing | SAP | HR |