C PROGRAMMING

C Programming: How to create a program in C?

C programming
Written by deathdealer

C Programming: How to create a program in C?

is a well known Computer Programming Language. Many Many and Many programs have already been written in C language. But for new mates, its difficult to learn C language without any reference. So if you are the one, don’t worry i am here to teach you with a simple and clean way.

C Programming Syntax:

Q: What is Syntax?

As you guys do lot of works every day. Every Work is done in its proper way. That proper way is known as syntax in C and in all other languages.

C Programming Steps:

Following Steps involves in Creating a C program.

  1. Writing the Code
  2. Compiling the Code
  3. Executing the Program.

Q: What is Program?

Every Software You Use on Your Computer is a program. A simple “Notepad“, “Calculator” and “Paint” etc.

All of these are programs. If you see a few messages in these programs such as

Notepad Dialogue Box

The message written in this Dialogue box

Do you want to save changes to Untitled?

was printed on this dialogue box by its programming language’s PRINT Function.

If this program is written in C Language then that line has be printed due to “printf” function of C.

What You know now?

  1. Every thing which you see on screen is due to a “Print” function of language.
  2. You Know about Syntax. (Proper Format)

What You Don’t Know?

  1. Source Code
  2. Object Code

C Programming: Source Code

When you write a program, all of its code is known as source code. WHY?
Because its just a simple Code you have written in simple English.

C Programming: Object Code

Compiling:

The process of Conversion of Human’s written English Source Code into Computers Binary Language is called Compiling.

After Compiling, You can execute that file on your PC which is now known as Object file, and the code of that object file is known as Object Code.

IF YOU HAVE ALL THE ABOVE CONCEPTS CLEARED YOU CAN SEE THE FOLLOWING CODE.

Caution: Don’t read the following code if you haven’t cleared the above concepts. because this will put a burden on your brain. And you might fail to understand it.

// Code started.

#include <stdio.h>

#include <conio.h>

int main()

{

printf("Hello World!");

return 0;

}

// Code Ended.

C programming: Code Explanation

  • The first line starting with “//” is a COMMENT.
  • Second and Third line starting with “#include” are HEADER files.
  • Fourth line starts main function. main()
  • Fifth Line has a starting { bracket of main() function.
  • Sixth Line has a printf function
  • seventh line returns a value to main function which is 0 (ZERO)
  • Eight line ends } Bracket of Main function.
  • Ninth line “//” you already know that its COMMENT.

Program Working:

Comments Won’t Run in Program.

All the commands present  in { } of main() function executes one by one.

In the present Case:

  • printf function will run first.
  • Then return function.

Enough For Today.

Actually i am creating a full course of C and all other popular languages over here.

So Make sure you bookmark my site and Share it with others too.

If you won’t understand any thing feel free to comment.

For back-link lovers. If you want to get link in article make sure to add mine in yours and contact me in comment box to get yours.

Make sure to

SUBSCRIBE

—–THEEND—–
Following sites contain some interesting info. you should check them out too.

About the author

deathdealer

Leave a Comment