Powered By Blogger

18 February 2017

PROGRAM TO PRINT NAME USING ARRAY

INPUT=

#include<iosteram>
using namespace std;
int main()
{
       char a[40]
       cout<<"Enter the no of alphabets =";
       cin>>n;
       cout<<"Enter your name =";
       for(i=0;i<n;i++)
       {
              cin>>a[i];
       }
       for(i=0;i<n;i++)
       {
              cout<<a[i];
       }
       return 0;
}


OUTPUT=

Enter the no of alphabets = 5
Enter your name = Harsh

Harsh

No comments:

Post a Comment