URI Online Judge Solution 1096 Sequence IJ 2 using C Programming Language.
Make a program that prints the sequence like the following exemple.
Input
This problem doesn't have input.
Output
Print the sequence like the example below.
Input Sample | Output Sample |
I=1 J=7
I=1 J=6 I=1 J=5 I=3 J=7 I=3 J=6 I=3 J=5 ... I=9 J=7 I=9 J=6 I=9 J=5 |
Solution using C :
#include <stdio.h>
int main() {
int i,j;
for(i=1; i<=9; i=i+2)
{
for(j=7; j>=5; j--)
printf("I=%d J=%d\n",i,j);
}
return 0;
}
Comments
Post a Comment