Jump To Content

C programming

C programming is easy and at the same time difficult too. Therefore, it is advised to pay attention at each and every line that follows.
STARTING WITH C
There are two ways of starting with C :-

    * Open MS-DOS prompt.
    * Type TC and press ENTER.
    * Now you have entered the huge world of C programming.

The next altenative is :

    * Open the folder which contains C files.
    * Double-click on the TC icon.

Basic terminology


Constants  -  Constants are those individual units whose value does not change during program execution. In other words, their value remains constant.For ex.- number 5

Variables  -  Variables are those units whose value can change during program execution. For ex.- initially we say that a = 5 and b = 0. then we say that b = a + 2 . Now b's value will be 7.

Operators  -  Operators are those directions which are used by the programmer to alter the variables' value. In the above example '+' is an operator which is used to change b's value.However, there are more operators which are used for some other processes as well.

Functions -  Functions can be defined as a group of statements which make use of variables, operators, etc. for completing a particular task. For example, printf is a function used in C to show output on the monitor.

A Simple Program
This program is used to display "this is easy !!!" on the monitor. Before beginning with the program, please note that every program contains a main function.


#include<stdio.h>
#include<conio.h>
void main()
{
printf("This is easy !!!");
getch();
}



The first two lines of the program tell the compiler to 'include' the header files. Header files are those files which are provided in C for user assistance. They contain some pre-defined functions. The 'main' is succeded by a bracket which tells the compiler that main is a function. Then the { brace tells it that the definition of the function begins. Since printf is also a function (although pre-defined) it is also succedded by a bracket. The bracket contains the sentence which is to be displayed. Please note " sign before and after the sentence. It tells the compiler where the sentence begins and where it ends. The semi-colon ; after the printf statement is necessary since it shows that the command is finished. Getch() is another function which implies that a key is to be pressed by the user at the time of execution. Lastly, the } brace tells that the main function has ended now.
 Hence the program displays the sentence "this is easy !!!"   and terminates as soon as the user presses a key.

ShyamSaraf
  • Authority 5
Post Body
ShyamSaraf said:

This lesson is really good for beginners. I think it provides a perfect start-up for learning the C language

  • Quote
  • Posted 5 months ago.
RobotGrrl
  • Authority 256
Post Body
RobotGrrl said:

Simple tutorial- good for newbies at programming or C :) Why is there a phone number there? Lol… wouldn’t you get a lot of calls if you post it on the internet?

  • Quote
  • Posted 5 months ago.
preet_ud
  • Authority 5
Post Body
preet_ud said:

very gud…. its very gud method of teaching.. thx…

  • Quote
  • Posted 4 months ago.
preet_ud
  • Authority 5
Post Body
preet_ud said:

how to go to next lesson???plz tell….

  • Quote
  • Posted 4 months ago.
shubhi
  • Authority 276
Post Body
shubhi said:

Really sorry!! I have not posted any other lesson till now! But if you say, I can add a new one!

  • Quote
  • Posted 4 months ago.
dcooldivya
  • Authority 39
Post Body
dcooldivya said:

thanks mam….really a nice one…m just a beginner…n ur lesson is really helpful

  • Quote
  • Posted 2 months ago.
dcooldivya
  • Authority 39
Post Body
dcooldivya said:

mmmm plzzz keep on posting more lessons…

  • Quote
  • Posted 2 months ago.
kir360
  • Authority 250
Post Body
kir360 said:

nice start…

When I had begun with C two years ago, I just thought I was impossible to self-study it. But this one seems to be very cool. Very simple start, I love it!
  • Quote
  • Posted about 1 month ago.
ArindamM
  • Authority 13
Post Body
ArindamM said:

when is the next lesson succeeding the above would come. I am eagerly awaiting the same. Its like taking virtual private tutors class.

  • Quote
  • Posted 26 days ago.
shubhi
  • Authority 276
Post Body
shubhi said:

Thanx to all of you. Just a bit busy now-a-days. I will try to post the next lesson in January!!! Thanx again.

  • Quote
  • Posted 16 days ago.
  • Your comment will be modifiable for 10 minutes after posted.

Page Author

Avatar
shubhi
Name
shubhi

From Here You Can…

Information

Most Recent Related Content

This work is public domain.