Write a Program to left and right justify in C

#include<stdio.h>
#include<conio.h>
void main()
{
int num;

printf("\n\nEnter any number: ");
scanf("%d",&num);

printf("\n\n Right Justify=%4d",num);

printf("\n\n Left Justify=%-4d",num);

getch();


}

Previous
Next Post »