RAVIANS COLLEGE OF SCIENCE PATTOKI: Question no. 12

Question no. 12

11. By default, output is right-justified in its field. You can left-justify text output using the
manipulator setiosflags(ios::left). (For now, don’t worry about what this new notation means.) Use
this manipulator, along with setw(), to help generate the following output:

Last name First name Street address Town State
-----------------------------------------------------------
Jones Bernard 109 Pine Lane Littletown MI
O’Brian Coleen 42 E. 99th Ave. Bigcity NY
Wong Harry 121-A Alabama St. Lakeville IL

Answer by WAJID

#include
#include
#include

void main(void)
{
char *l_name[3] = {"Jones", "O'Brian", "Wong"},
*f_name[3] = {"Bernard", "Coleen", "Harry"},
*adress[3] = {"109 Pine Lane", "42 E. 99th Ave.", "121-A Alabama St."},
*town[3] = {"Littletown", "Bigcity", "Lakeville"},
*state[3] = {"MI", "NY", "IL"};

do{
cout< < < < < < for(int i=0;i<60;i++) cout<<"-";
for(int j=0;j<3;j++){
cout< < < < < < cout<<"\n !Press c to continue or any key to exit."< }while(getch()=='c');
}

BEST OF LUCK

No comments:

Post a Comment

Copyright © RAVIANS COLLEGE OF SCIENCE PATTOKI Urang-kurai