/*WAP to formatting integer*/
#include<stdio.h> #include<conio.h> main( ) { int weight = 63 ; printf ( "\nweight is %d kg", weight ) ; printf ( "\nweight is %2d kg", weight ) ; printf ( "\nweight is %4d kg", weight ) ; printf ( "\nweight is %6d kg", weight ) ; printf ( "\nweight is %-6d kg", weight ) ; getch(); }
No comments:
Post a Comment