Jeremiah_

1098 - URI - Sequência IJ 4 (Sequence IJ 4) in C

Apr 6th, 2018
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.42 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <math.h>
  3. int main() {
  4.  
  5.     double i, j, nj;
  6.     for(i=0; i<=2.0; i+=0.2){
  7.         for(j=1.0; j<=3.0; j++){
  8.             nj=j+i;
  9.             if(nj == 1.0 || nj == 2.0 || nj == 3.0 || nj == 4.0 || nj == 5.0){
  10.                 printf("I=%.0lf J=%.0lf\n", i, nj);
  11.             }
  12.             else{
  13.                 printf("I=%.1lf J=%.1lf\n", i, nj);
  14.             }
  15.         }
  16.     }
  17.     return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment