QUESTION: -a program using multi-condition and relational operator in the same loop
#include <stdio.h>
#include <conio.h>
void main()
{
int no, oo;
printf("enter a value a: ");
scanf("%d", &no);
printf("enter a value b: ");
scanf("%d", &oo);
for (int i = no, j = 2; i >= 1 && j <= oo; i--, j++)
// in the above condition we can also remove one condition,
but program will execute with the help of another.
// using relational operator(and) both the condition will
run until both condition wont satisfied.
{
printf("%d \t", i);
printf("%d \n", j);
}
getch();
}
OUTPUT
enter a value a: 10
enter a value b: 15
10 2
9 3
8 4
7 5
6 6
5 7
4 8
3 9
2 10
1 11
0 Comments