Sunday 18 August 2013

Character With Get() and Put()

#include<iostream.h>
#include<conio.h>
void main()
{
    clrscr();
    int count=0;
    char c;

    cout<<"\n Enter Text : ";
    cin.get(c);

    while(c!='\n')
    {
        cout.put(c);
        count++;
        cin.get(c);
    }
    cout<<"\n Number of characters = "<<count;
    getch();
}

Here Is The Output :)


No comments:

Post a Comment