Write a program to read multi-word string using get function


 

/* Write a program to read multi-word string using get function*/

#include<iostream.h>

#include<conio.h>

#include<string.h>

void main()

{

const int max=20;

char str[max];

clrscr();

cout<<“enter the string value=”;

cin.get(str,max);

cout<<“string is=”<<str;

getch();

}

/* output:

enter the string value=gurnoor

string is=gurnoor*/

Related Posts

Comments are closed.