ankitweblogic logo
W e b t u t o r i a l s

Programing Approach


Flow Chart

Define C

Define Programming

C - Syntax

C - Variables

C - Keywords

C - Data Types

C - Comments

Turbo C - Shortcut keys

C - Operators

Hierarchy of Operators

Ex: Arithmetic Operator

Constant Variable

C - Escape Sequence

Control Structure - if

Ex: If condition

Ex: Inc / Dec Operator

C - loops

Ex: Loops

C - Nesting Of loops

Ex: Nested Loops

Jumping Statements

C - Arrays 1D

C - Arrays 2D

C - Sorting


Character I/O Function

C - Strings

Ex: Strings

Array of Strings

C - Math Functions

User-defined Function

Exercise Function

C - Types of Functions

Storage Class

C - Header Files

C - Preprocessor

C - Pointers

C - Structures

C - Typedef

C - File Handling

Ex: File Handling

Command Line Argument


C - Syntax

Syntax defines the set of rules for writing programs. Every language specification defines its own syntax.

A program in C-Language can be composed of:

  • Variables − Represents a named in memory block that can store values for the program.
  • Literals − Represents constant/fixed values.
  • Operators − Symbols that define how the operands will be processed.
  • Keywords − Words that have a special meaning in the context of a language.

First C Program

In this tutorial, we are using Turbo C++ compiler and integrated development environment (IDE), which is originally from Borland.

Example 1: WAP to print a Message "This is my first C Program"

void main()
    printf("This is my first C Program"); /*to print the statement*/
This is my first C Program

Code Explanation:

  • stdio - Standard input output
  • .h - header file
  • conio - Console input output
  • main is a function from where a program start its execution.
  • { } - curly brackets define the scope of the program
  • clrscr() - to clear the screen. It will clear the output screen so that previous output will be cleared when running a new program.
  • printf() is a function which is use to print the string
  • scanf() function is use to receive the values from user
  • & means address of a variable

Example 2: WAP to Input 2 number and find sum.

void main()
    int a, b, c;
    printf("Enter 1st Number: ");
    printf("Enter 2nd Number: ");
    printf("Sum = %d",c);
Enter 1st Number: 10
Enter 2nd Number: 20
Sum = 30
Updated: 15-Mar-19