program to find Element at position in Array

#include<iostream.h>
#include<conio.h>
#include<string.h>
    void  main ( )
    {
        char s [ 15 ] ;
        int i , p ;
           cout<< "\nEnter any string : ";
           cin>>s;
        p = strlen ( s ) ;
          for ( i = 0; i < p ; i ++ )
                cout<< "\nElement at position "<<i+1<<" is"<< s[i] ;
          getch ( ) ;
    }

No comments:

Post a Comment