Advertisement
alvinfnaldi

bahasa c

Nov 9th, 2019
272
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.60 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <conio.h>
  3.  
  4. void main()
  5. {
  6.     char A = *"A";
  7.     char B[9] = "bahasa C";
  8.     int C = 1234;
  9.     int D = -400;
  10.     float E = 123.4567;
  11.     float F = 12.0;
  12.  
  13.     printf("%-5c\n", A);
  14.     printf("%-15s\n", B);
  15.     printf("%15.3s\n", B);
  16.     printf("%3i\n", C);
  17.     printf("%07d\n", C);
  18.     printf("%-7d\n", C);
  19.     printf("%+-3i\n", C);
  20.     printf("%+6i\n", D);
  21.     printf("%-6d\n", D);
  22.     printf("%u\n", D);
  23.     printf("%-15f\n", E);
  24.     printf("%09.2f\n", E);
  25.     printf("%15.0f\n", E);
  26.     printf("%7g dan %#7g\n", F, F);
  27.     printf("%#x dan %#o\n", C, C);
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement