Header Ads Widget

Responsive Advertisement

Ticker

6/recent/ticker-posts

Convert a string to ASCII in c ?

 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 ;  
   }  
 } 

 

Post a Comment

0 Comments