\n (BACK SLASH n) :-
* Write a program to print your Name & Qualification.
It is used to generate new line or next line.
\t (BACK SLASH t) :-
\t (BACK SLASH t) :-
It is used to generate eight spaces.
Example 1:-
1st Way
#include<stdio.h> #include<conio.h> void main( ) { clrscr( ); printf("One\n"); printf("Two\n"); printf("Three"); getch( ); } |
2nd Way
#include<stdio.h> #include<conio.h> void main( ) { clrscr( ); printf("One"); printf("\nTwo"); printf("\nThree"); getch( ); } |
3rd Way
#include<stdio.h> #include<conio.h> void main( ) { clrscr( ); printf("One"); printf("\nTwo\n"); printf("Three"); getch( ); } |
4th Way
#include<stdio.h> #include<conio.h> void main( ) { clrscr( ); printf("One\nTwo\nThree"); getch( ); } |
Output:-
One Two Three |
Example 2:-
#include<stdio.h>
#include<conio.h> void main( ) { clrscr( ); printf("1\t"); printf("2"); getch( ); } |
Output:-
1 2 |
Example-3:-
1st Way
#include<stdio.h>
#include<conio.h> void main( ) { clrscr( ); printf("*\n"); printf("*\t*\n"); printf("*\t*\t*"); getch( ); } |
2nd Way
#include<stdio.h>
#include<conio.h> void main( ) { clrscr( ); printf("*\n*\t*\n*\t*\t*"); getch( ); } |
Output:-
*
* *
* *
*
|
Example-4:-
#include<stdio.h>
#include<conio.h> void main( ) { clrscr( ); printf("*\n*\t*\n*\t*\t*"); getch( ); } |
Output:-
*
* *
* * *
|
* Write a program to print your Name & Qualification.
#include<stdio.h>
#include<conio.h> void main( ) { clrscr( ); printf("My name is PRASAD\n"); printf("My Qualification is B.tech I.T"); getch( ); } |
Output:-
My name
is PRASAD
My Qualification
is B.tech I.T
|
* Write a program to print your Resume.
#include<stdio.h>
#include<conio.h> void main( ) { clrscr( ); printf("\t\tRESUME\n\t\t======\n"); printf("Name\t:\tPRASAD\n"); printf("FName\t:\tSANKER\n"); printf("DOB\t:\t28:03:1990\n"); printf("City\t:\tPARCHOOR\n"); printf("Ph.No\t:\t9700******\n"); getch( ); } |
Output:-
RESUME
=======
Fname : SANKER DOB : 28:03:1990 City : PARCHOOR Ph.No : 9700****** |
__________________________________________________________________________________
__________________________________________________________________________________
Post a Comment