Q:

C Program to Input a String & Store their Ascii Values in an Integer Array & Print the Array

0

C Program to Input a String & Store their Ascii Values in an Integer Array & Print the Array

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

#include <stdio.h>
    void main()
    {
 
        char string[20];
        int n, count = 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 (count < n)
        {
            printf(" %c = %d\n", string[count], string[count] );
            ++ count ;
        }
 
    }

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now