How To Make Program In C Language

How To Make Program In C Language


How To Make Program In C Language



How To Make Program In C Language


How To Make Program In C Language


     1. C is developed by Dennis Richie at 1972 at Bell Laboratories in the U.S.A.
     2. C is a middle-level language.
     3. STDIO = Standard input and output 
     4. STDIO = It is used for the printf and scanf.
     5. printf  = output statement
     6. scanf = input statement
     7. conio = It is used for clrscr and getch
     8. clrscr = It is used to clear the previous output.
     9. getch = It is used to show the output screen.
     10. H = Header files
     11. Alt+F9 = To compile the C program.
     12. ctrl+F9 = To run the C program.

Comment

     It has two types

1. Single line comment = It will not execute one single line symbol - //

2. Multiline comment = It will not execute more than one line symbol - /*...*/


Single Line Comment
Input:


#include
#include
void main()
{
    clrscr();
    //printf("arun");
    printf("kumar");
    printf("selva");
    getch();
}

Output:

kumarselva

Multi-Line Comment
Input:
#include
#include
void main()
{
clrscr();
/*printf("arun");
printf("kumar")*/
printf("selva");
getch();
}
output:

selva

Escape Sequences

     \n - new lines
     \t  - horizontal tab
     \b - backspace
     \r - carriage return
     \a - bell sound
     \\ - backslash
     \? - question mark
     \' - single quotes
     \'' - double quotes

Input:


#include
#include
void main()
{
clrscr();
printf("\n\tar \bun");
printf("\n\tkum \bar");
printf("\n\t\t\t sel \bva");
getch();
}

Output:


arun                                                                                                      
        kumar                                                                                                     
                         selva 

Carriage Return
Input:


#include
#include
void main()
{
clrscr();
printf("\narun \rkumar");
getch();
}

Output:


kumar

Post a Comment

0 Comments