use of get() and put() function in c++ .

 



#include<iostream>
using namespace std;
#include<cstring>
int main()
{
    int count=0;
    char c;
    cout<<"INPUT STRING :"<<endl;
    c = cin.get();
    while (c!='\n')
    {
        cout.put(c);
        count++;
        cin.get(c);
    }
    cout<<"\nnumber of characters : "<<count<<endl;
}


output :
INPUT STRING : rahul chaurasiya rahul chaurasiya number of characters : 16


Comments