C Language : Solution - 02

 

ASCII Table


1. Write a program to print "INDIA" by using ascii values.

#include<stdio.h>

#include<conio.h>

void main()

{

printf("%c%c%c%c%c", 73,78,68,73,65);

getch();

}

-: Output :-


2. Write a program to print "GOEL" by using ascii values.

#include<stdio.h>

#include<conio.h>

void main()

{

printf("%c%c%c%c", 71,79,69,76);

getch();

}

-: Output :-

 

3. Write a program to print diamond pattern using only printf functins.

#include<stdio.h>

#include<conio.h>

void main()

{

   printf("     *\n");

   printf("    ***\n");

   printf("   *****\n");

   printf("  *******\n");

   printf(" *********\n");

   printf("  *******\n");

   printf("   *****\n");

   printf("    ***\n");

   printf("     *\n");

 getch();

}

-: Output :-

Mj Mausam

Post a Comment

Previous Post Next Post