P173. Program to find length of a string using command line input.
#include<stdio.h>
#include<string.h>
void
main(int argc,char **argv)
{
if(argc!=2)
{
printf("Usage ./a.out
String \n");
return;
}
for(int i=1;i<argc;i++)
printf("%ld\n",strlen(argv[i]));
}
Comments
Post a Comment