ਇਕ ਸਟਰਿੰਗ ਦੀ ਲੰਬਾਈ ਪਤਾ ਕਰਨ ਲਈ ਪ੍ਰੋਗਰਾਮ ਲਿਖੋ।

#include <stdio.h>
#include <conio.h>
#include <string.h>

void main()
{
    char str[20];
    int l;
   
    puts("Enter a string: ");
    gets(str);
   
    l=strlen(str);   
    printf("Size of string %s is %d",str,l);
    getch();
}

Output:

Comments