​C++ PROGRAM TO ILLUSTRATE THE USE OF cin.getline and cout.write  – tutorial 4

0
526

heyaa guys capstricks.net back and this time to learn the use of cin.getline and cout.write so without wasting time lets get started

code-

#include<iostream.h>

#include<string.h>

void main()

{

 char fname[50],lname[50];

cout<<“enter your first name \n”;

cin.getline(fname,50);

cout<<“enter your last name \n”;

cin.getline(lname,50);

cout<<“hello’;

int l1,l2;

l1=strlent(fname);

l2=strlen(lname);

cout.write(fname,l1);

cout<<“\t”;

cout.write(lname,l2);

}


output

enter your first name

lakhwinder

enter your last name

singh

hello! lakhwinder singh
wohooo more progress now proceed further for next tutorial 5

Originally posted 2017-01-17 12:02:26. Republished by Blog Post Promoter

also read:-  Android N 7.1.1 for Coolpad note 3