Advertisement
sunu

mod and print percent sign

Jan 21st, 2012
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.29 KB | None | 0 0
  1. //Contoh kode untuk demo mod dan contoh menampilkan tanda percent % di printf
  2.  
  3. #include<stdio.h>
  4. #include <stdlib.h>
  5.  
  6.  
  7.  
  8. int main(){
  9.   unsigned int i, denom=2;
  10.  
  11.   for(i=0; i<=50; i++){
  12.     printf("Nilai %d %c %d adalah: %d \n",i,'%',denom,(i%denom));
  13.     //
  14.   }
  15.  
  16.   return 1;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement