WAP using printf() function and different escape sequences

WAP using printf() function and different escape sequences

Write a program using printf() function and different escape sequences to give the output.

printf() function

#include<stdio.h>
#include<conio.h>

int main() {
  printf("First name \t Last name \t Marks\n\n");
  printf("\t\tNote: < 30 is \"fail\"\n\n");
  printf("\t\t\\\\ \"End\" //");
  getch();
  return 0;
}

printf(): printf() function is used to print the “character, string, float, integer, octal and hexadecimal values” onto the output screen.

\t stand for tab and used to give space.

\n stand for a new-line and used to print from a new line.

Also learn, how to print the ASCII value of a character.

Share this post