Advertisement
Leonard_M

roxi

Mar 27th, 2020
758
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.46 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6.     float x = -12.257;
  7.     int i=21, v=7;
  8.     char antet[20] = "Anul 1 Fizica UBB";
  9.  
  10.     printf("\n1. %-5.2f\t%d", x, i/2);
  11.     printf("\n2. %.13s\b", antet);
  12.     printf("\n3. %13s", antet);
  13.     printf("\n4. %d", v>>1);
  14.  
  15. //    0101 = 2^0 * 1 + 2^1 * 0 + 2^2 * 1 + 2^3 * 0
  16. //    0010 = 2
  17. //    7/2=3 r 1
  18. //    3/2=1 r 1
  19. //    1/2=0 r 1
  20. //        0000 0111 >> 1 = 0000 0011 = 3
  21.  
  22.     return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement