#include<iostream.h>
#include<stdio.h>
void main()
{
char a[50];
int i;
cout<<"enter the string:";
gets(a);
for(i=0;a[i]!='\0';++i)
;
cout<<"\nthe size of string is ="<<i;
}

int his program we simply start to check from the starting which number eleement is the nullcharacter which signifies the end of the string and the number so obtained add one to it and that is the size of the string one is added because in array first element has address 0 whreas while counting we take first element as 1