Showing posts with label String length. Show all posts
Showing posts with label String length. Show all posts

Monday, 29 October 2012

Program Of Sub String In C++

#include<iostream.h>
#include<conio.h>
#include<stdio.h>
 
main()
 
 {
 
clrscr(); 
char x[20];
 
int l; 
puts("Enter string=");
 
gets(x);
 
getch();
 
}
 
void substr(char a[20]) 

{
 
int beg,end,i;
 
cout<<"Enter Beging & Ending Number=";
 
cin>>beg>>end;
 
{
 
cout<<a[i];
 
}
 
}

Saturday, 11 February 2012

Find String length In C


#include<stdio.h>
#include<conio.h>
main()
{
clrscr();
char a[20];
int l;
printf("Enter String =");
scanf("%s",a);
l=strlen(a);
printf("length of String=%d",l);
getch();
}