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 4 months ago.
RobotGrrl
  • Authority 231
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 4 months ago.
preet_ud
  • Authority 5
Post Body
preet_ud said:

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

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

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

  • Quote
  • Posted 2 months ago.
shubhi
  • Authority 261
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 2 months ago.
dcooldivya
  • Authority 37
Post Body
dcooldivya said:

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

  • Quote
  • Posted about 1 month ago.
dcooldivya
  • Authority 37
Post Body
dcooldivya said:

mmmm plzzz keep on posting more lessons…

  • Quote
  • Posted about 1 month ago.
kir360
  • Authority 229
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 15 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

  • Lesson
    Avatar
    Avatar
    Title
    Building Blocks for Data Structures
    Body
    It’s difficult if not impossible to start any programming project witho...
    Author
    melancton melancton
  • Lesson
    Avatar
    Avatar
    Title
    More On Functions
    Body
    Inline Functions Functions with small code can be declared as inline.Where...
    Author
    zainvi_sf zainvi_sf
  • Presentation
    Avatar
    Avatar
    Title
    How To Succed...
    Description
    Hi, this is a very nice presentation and the credit goes to the original auth...
    Author
    Sureshbala Sureshbala
  • Lesson
    Avatar
    Avatar
    Title
    C++ As Better C
    Body
    Before moving on further in advanced C++, it is better to ensure us that C++ ...
    Author
    zainvi_sf zainvi_sf
  • Lesson
    Avatar
    Avatar
    Title
    Functions - Basic Concept
    Body
    Today, we will see yet another concept present in any programming language. N...
    Author
    zainvi_sf zainvi_sf
  • Lesson
    Avatar
    Avatar
    Title
    Using md5 sums
    Body
    Once you have downloaded a file from the internet, it is always nice to check...
    Author
    anteaya anteaya
  • Lesson
    Avatar
    Avatar
    Title
    More On Classes
    Body
    OOP encapsulates data(attributes) and functions(behaviors) into packages call...
    Author
    zainvi_sf zainvi_sf
  • Lesson
    Avatar
    Avatar
    Title
    Union, Typedef, Enums
    Body
    By now, you already know what is an array, what is a structure, and how to us...
    Author
    zainvi_sf zainvi_sf
This work is public domain.