08 March, 2013

C Program For Printing ASCII Values On Screen/Console.

This Post Contains A C Program For Printing ASCII Values On Screen/Console With Correct Source Code & Output. This Program Is Written, Compiled & Executed At TurboC/C++3.0 Compiler & Will Help You To Understand The Concept Of 'For-loop' From C Language. It Is A Well-Structured Program With Proper Comments Which Provides Step-By-Step Description Of Various Features Of The Language In A Simple & Easy-To-Understand Way.

# Note : You Can Simply Copy-Paste The Following Program Or Code Into Compiler For Direct Result.


C Program For Printing ASCII Values On Console.

#include<stdio.h>
#include<conio.h>
void main()
{
    int i = 1;
    char Ans = 'y';
    clrscr();
   
    printf("\t\t\t :: Welcome To 'ASCII' Program ::");
    
    printf("\t\t\t\tNo    ASCII Value");
    
    do
    {
        if(i % 10 == 0)
        {
            printf("\t\t\t\t%d     =     %c", i, i);
            
            printf("Do You Want To Continue...? (Y/N) :\a\t");
            fflush(stdin);
            scanf("%c", &Ans);
        }
        else
        {
            printf("\t\t\t\t%d     =     %c\n", i, i);
            printf("\r\n");
        }
        i++;
    }while((Ans == 'y') || (Ans == 'Y'));
    getch();
}
Output :

The Output Will Be The ASCII Values Of All The Respective Characters, Which Are Valid.







No comments:

Post a Comment

Subscribe To:

Most Commonly Asked Programs In 'C' & 'C++' Language.