Use of \t in C++
'\t' is a horizontal tab . It is used for giving tab space horizontally in your output
For example,
Write a C++ program to display the following-
Name Marks
Raj 76.5
Geeta 85.5
Simmy 93.5
Source code:
#include<iostream.h>
#include<conio.h>
void main()
{ clrscr();
cout<<"Name\t\tMarks"<<endl;
cout<<"Raj\t\t76.5"<<endl;
cout<<"Geeta\t\t85.5"<<endl;
cout<<"Simmy\t\t93.5"<<endl;
getch();
}
Output:
No comments:
Post a Comment