Convert a string to ASCII in c ?
#include <stdio.h>
#include<conio.h>
void main()
{
char string[200];
int n, c = 0;
printf("Enter the no of characters present in an array \n ");
scanf("%d", &n);
printf(" Enter the string of %d characters \n" , n);
scanf("%s", string);
while (c < n)
{
printf(" %c = %d\n", string[count], string[c] );
++ c ;
}
}
No comments:
Post a Comment