Header Ads

C program to Print Smiley on Screen

To print smiling face on the screen in C programming, use the ASCII value of smiling face which is 1.

Following C program ask to the user that how many smiling face he or she want to print on the screen to print the required number of smiling face on the screen:

************Source*Code**************
#include<stdio.h>
#include<conio.h>
void main()
  {
    int sml=1, i, limit;
    printf("How many smiley face you want to print ? ");
    scanf("%d",&limit);
    for(i=0; i<limit; i++)
       {
            printf("%c ",sml);
        }
        getch();
   }


****************Output*****************


screenshot


No comments