Escape sequence \t moves the cursor to the next tab space. - C Language Basics

C examples for Language Basics:printf

Introduction

\t escape sequence is useful for formatting output.

The following code create columns in your output.

Demo Code

#include <stdio.h>

int main()/*from   w  w  w.j a v  a2s.co  m*/
{
    printf("\nSun\tMon\tTue\tWed\tThu\tFri\tSat\n"); 
    
    printf("\t\t\t\t1\t2\t3\n"); 
    
    printf("4\t5\t6\t7\t8\t9\t10\n"); 
    
    printf("11\t12\t13\t14\t15\t16\t17\n"); 
    
    printf("18\t19\t20\t21\t22\t23\t24\n"); 
    
    printf("25\t26\t27\t28\t29\t30\t31\n"); 

    return 0;
}

Result


Related Tutorials