Logo 
Search:

C++ Programming Forum

Ask Question   UnAnswered
Home » Forum » C++ Programming       RSS Feeds

displaying out in a column form

  Asked By: Boygene    Date: Sep 16    Category: C++ Programming    Views: 520
  

hello.. i wish to to display the output in column form..but i dont understand the problem with my code.. plz help

#include <iostream>
#include<iomanip>
#include<cstring>
using namespace std;
using std::setw;

int main(){

string name;
int age,Class;
int n,i;
for(n!=0;n<=4;n++)
{
cout<<"enter your name ";
cin>>name;
cout<<"enter age ";
cin>>age;
cout<<"enter class ";
cin>>Class;
}
cout<<"name "<<setw(7)<<name<<setw(7)<<"age "<<setw(7)<<age<<setw(7)<<"Class "<<setw(7)<<Class<<endl;

for(i=!0;i<=4;i++){


cout<<name<<setw(10)<<age<<setw(10)<<Class<<endl;

}
return 0;}

Share: 

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on displaying out in a column form Or get search suggestion and latest updates.




Tagged: