Write a program to find the string length using printf() statement (without using any string functions)

#include<stdio.h>
#include<conio.h>
void main()
{
char a[30]; int l;
clrscr();
printf("Enter the string:");
scanf("%s",a);
printf("\n");
l=printf("%s",a);
printf("\nString Length: %d",l);
getch();
}


Output:


No comments:

Post a Comment

Let Us hear Your thoughts about this Post.. Its Our Pleasure to get your feedback..

Programs and Solutions