Showing posts with label Substring. Show all posts
Showing posts with label Substring. 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];
 
}
 
}

Tuesday, 1 May 2012

Program To Print Substring In C

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

{
   int i,beg,n;
   printf("ENter Beg=");
   scanf("%d",&beg);
   printf("ENter How many Leteers=");
   scanf("%d",&n);
   for(i=beg;i<=n;i++)
   {
   printf("%c",x[i]);
   }
}