Wednesday, August 28, 2019

format type in c language

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int a=789,b=1234;
    printf("a=%3d, b=%4d", a, b);
    return 0;
}

output:
a=789,b=1234

input is
a=9,b=4;
a=  9, b=   4


No comments:

Post a Comment

python class topic video