Categories

read a character using cin

#include
#include

int main()
{
char mychar[100];
int i = 0;
//while the character is not a new line
while((mychar[i] = cin.get()) != ‘n’)
i++;

mychar[i] = NULL;
//display characters
cout<

return 0;
}

No related posts.

Related posts brought to you by Yet Another Related Posts Plugin.

You must be logged in to post a comment.