Showing posts with label accepting and displaying data in c programming. Show all posts
Showing posts with label accepting and displaying data in c programming. Show all posts

Program to find the ASCII values of the \n,\r,\t,\a,and \b

//Program to find the ASCII values of the \n,\r,\t,\a,and \b
#include<stdio.h>
#include<conio.h>
int main()
{

clrscr();
printf("ASCII value of \\n is =%d",'\n');
printf("\nASCII value of \\r is =%d",'\r');
printf("\nASCII value of \\t is =%d",'\t');
printf("\nASCII value of \\a is =%d",'\a');
printf("\nASCII value of \\b is =%d",'\b');
getch();
return 0;

}

To Run this Program Copy it in text editor and save as .c
Then double click on it and then it will get opened in your compiler.
Click on run.

Program to Accept and Display Address

//Program to Accept and Display Address
#include<stdio.h>
#include<conio.h>
int main()
{
   int a;
   unsigned b;//As your pin code is big integer constant
   char *ch1,*ch2,*ch3;//Strings to accept Street, City and Name
   clrscr();
   printf("Enter the name\n");
   gets(ch1);
   printf("\nEnter Door No and Street");
   printf("\n");
   scanf("%d",&a);
   fflush(stdin);
   gets(ch2);
   printf("\nEnter City and Pin code\n");
   gets(ch3);
   scanf("%d",&b);
   printf("\nName : %s",ch1);
   printf("\nDoor No. : %d    Street : %s",a,ch2);
   printf("\nCity : %s   Pin Code : %u",ch3,b);
   getch();
   return 0;
}

To Run this Program Copy it in text editor and save as .c
Then double click on it and then it will get opened in your compiler.
Click on run.