WAP TO CACLULATE LENGTH OF STRING

 

#include<iostream.h>

#include<>conio.h
#include<string.h>
#include<stdio.h>
Void main()
{
     char str[50];
     int len=0;
     clrscr();
     cout<<”Enter the string:”;
     gets(str);
     for(int i=0;str[i]!=’\0’;i++)
     {
            len=len+1;
     }
      cout<<”Length of string is:”;
      getch();

  }

Comments

Popular Posts