Dremendo Tag Line

Print string with tabs in C

printf() - Question 2

In this question, we will see how to print string with tabs in C programming using the printf() function. To know more about printf() function click on the printf() function 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 <stdio.h>
#include <conio.h>

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

Output

Tiger   Elephant        Lion
video-poster