C program for select the char which u want , C/C++ Programming

C Program for SELECT THE CHAR WHICH U WANT

#include stdio.h>

#include conio.h>

void main()

{

 

          void substr(char[], int *, int *);

          int a,b;

          char ch[20];

          clrscr();

          printf("ENTER THE STRING:  ");

          gets(ch);

          printf("\nENTER THE POSITION: ");

          scanf("%d",&a);

          printf("\nEnter The Length: ");

          scanf("%d",&b);

          substr(ch,&a,&b);

          getch();

}

void substr(char ch[20],int *s, int *t)

{

          int i;

          for(i=*s;i<(*t+*s);i++)

                   putchar(ch[i]);

}

 

OUTPUT :

ENTER THE STRING : KAMLESH

ENTER THE POSITION: 2

ENTER THE LENGTH: 3

MLE

 

 

 

Posted Date: 9/10/2012 8:15:57 AM | Location : United States







Related Discussions:- C program for select the char which u want , Assignment Help, Ask Question on C program for select the char which u want , Get Answer, Expert's Help, C program for select the char which u want Discussions

Write discussion on C program for select the char which u want
Your posts are moderated
Related Questions
A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your task is to convert S to palindrome

Question 1: (a) Explain clearly the following concepts using suitable examples of your own:- (i) concrete class v/s abstract class (ii) constructor v/s over

What is conversion operator? Explain it with example.

Program is to store all ASCII char into a file: void main()     {   ofstream  fout("ascii.txt");   int i,n=256;   for(i=1;i     {     fout     }

how to write a program using arrays

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two points can b

Simple program of c++: int main() {    int   bushels;    float dollars, rate;                 cout                 cin >> dollars;                 cout

C++ Programming Assignment ATM Machine Phase 1 In this assignment you will create a program that allows a user to do the following: 1) Create a bank account by supplying a use

Define Functions with arguments and no return values The calling function will read a data from the terminal and pass it on to called as function and this will work good as the

Program to define an array in c: Write a program to define an array and print the value of array. void main() { int a[10]={0,11,21,34,44,75,46,57,88,89},i,j,k; clr