sunu icon

mod and print percent sign

sunu | PRO | 01/21/12 07:36:45 AM UTC | 0 ⭐ | 501 👁️ | Never ⏰ | []
C |

290 B

|

None

|

0 👍

/

0 👎

//Contoh kode untuk demo mod dan contoh menampilkan tanda percent % di printf
 
#include<stdio.h>
#include <stdlib.h>
 
 
 
int main(){
  unsigned int i, denom=2;
  
  for(i=0; i<=50; i++){
    printf("Nilai %d %c %d adalah: %d \n",i,'%',denom,(i%denom));
    //
  }
 
  return 1;
}

Comments