Identify the Number of Assigned Element in a String
In this tutorial the main goal is to identify the corresponding element based on the input string.
Output:
#include <stdio.h>I used the gets function to get string and strlen to get the length of the string and put in to condition.
int main()
{
//Examination A
char schl[100];
int i;
int c;
printf("Enter the string: ");
gets(schl);
c = strlen(schl);
for( i=0; i < c; i++)
{
printf("Element [%d]: %c\n", i, schl[i] );
}
return 0;
}
Output:
Identify the Number of Assigned Element in a String
Reviewed by code-dev
on
10:31 PM
Rating:
No comments: