Dremendo Tag Line
t

Print string with tabs in C++

cout - Question 2

In this question, we will see how to print string with tabs in C++ programming using the cout statement. To know more about cout statement click on the cout statement lesson.

Q2) Write a program in C++ to print the name of 3 animals in a single line on the screen using tabs between the names.

Program

#include <iostream>
#include <conio.h>

using namespace std;

int main()
{
    cout<<"Tiger\tElephant\tLion";
    return 0;
}

Output

Tiger   Elephant        Lion
video-poster