WAP to print 2 columns of numbers from 1 to 100 and 100 to 1, provided that there should never be same numbers in a row… ex: 2 2 is never printed
WAP to print 2 columns of numbers from 1 to 100 and 100 to 1, provided that there should never be same numbers in a row… ex: 2 2 is never printed
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
clrscr();
for(i=1,j=100;i<=100,j>=1;i++,j--)
{
if(i==j)
continue;
else
printf("%d,%d ,",i,j);
}
getch();
}
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
clrscr();
for(i=1,j=100;i<=100,j>=1;i++,j--)
{
if(i==j)
continue;
else
printf("%d,%d ,",i,j);
}
getch();
}