//WAP TO PRINT ASCII VALUES OF ENTERED CHARACTERS.
#include<conio.h>
#include<stdio.h>
void main()
{
char a[20],ch='Y';
int i,x;
clrscr();
do
{
fflush(stdin);
printf("\n\nENTER THE STRING:");
gets(a);
printf("\n\nENTERED STRING IS");
printf("\n\n");
puts(a);
printf("\n\nASCII VALUES FOR ENTERED STRING IS:");
for(i=0;a[i]!='\0';i++)
{
printf("\n\n");
printf("%d",a[i]);
}
printf("\n\nDO YOU WANT TO CONTINUE?");
scanf("%s",&ch);
}while(ch=='y'||ch=='Y');
printf("\n\nBYE!!!BYE!!!\n\nProgrmmer:ABHISHEK WADHWA");
getch();
}
/*----------------------------------------------------------------------
OUTPUT
------------------------------------------------------------------------
73
74
75
DO YOU WANT TO CONTINUEY
ENTER THE STRING:!@#$%^&*()_+
ENTERED STRING IS
!@#$%^&*()_+
ASCII VALUES FOR ENTERED STRING IS:
33
64
35
36
37
94
38
42
40
41
95
43
DO YOU WANT TO CONTINUE?N
BYE!!!BYE!!!
Progrmmer:ABHISHEK WADHWA
*/
#include<conio.h>
#include<stdio.h>
void main()
{
char a[20],ch='Y';
int i,x;
clrscr();
do
{
fflush(stdin);
printf("\n\nENTER THE STRING:");
gets(a);
printf("\n\nENTERED STRING IS");
printf("\n\n");
puts(a);
printf("\n\nASCII VALUES FOR ENTERED STRING IS:");
for(i=0;a[i]!='\0';i++)
{
printf("\n\n");
printf("%d",a[i]);
}
printf("\n\nDO YOU WANT TO CONTINUE?");
scanf("%s",&ch);
}while(ch=='y'||ch=='Y');
printf("\n\nBYE!!!BYE!!!\n\nProgrmmer:ABHISHEK WADHWA");
getch();
}
/*----------------------------------------------------------------------
OUTPUT
------------------------------------------------------------------------
73
74
75
DO YOU WANT TO CONTINUEY
ENTER THE STRING:!@#$%^&*()_+
ENTERED STRING IS
!@#$%^&*()_+
ASCII VALUES FOR ENTERED STRING IS:
33
64
35
36
37
94
38
42
40
41
95
43
DO YOU WANT TO CONTINUE?N
BYE!!!BYE!!!
Progrmmer:ABHISHEK WADHWA
*/
No comments:
Post a Comment