Problem Description
Manoj arranged one event to find no of characters in his friends name, your idea is to give your friends name, for that
manoj has to answer the no of characters present in it, with the help of sturcuture concept accomplish it.
Input Method
Name of different friends
Output Method
No of characters
Use Structure ConceptsCODING ARENA
#include <stdio.h>
#include<string.h>
struct slen
{
char str[100];
int ln;
}s;
int main()
{
scanf("%s",s.str);
s.ln=strlen(s.str);
printf("%d\n",s.ln);
return 0;
}
Test Case 1
Input (stdin)raja
Expected Output4
Test Case 2
Input (stdin)rambabu
Expected Output7
No comments:
Post a Comment