Showing posts with label Wrie a program to find the string length using printf() statement (without using any string functions). Show all posts
Showing posts with label Wrie a program to find the string length using printf() statement (without using any string functions). Show all posts

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:


Programs and Solutions