C Language (Conversion Celcius b/w farheniet)
#include
#include
void main()
{
clrscr();
int a,e,s,o;
printf("For Even Nos type 1 and for ODD Nos type 2");
scanf("%d",&o);
printf("\n Enter starting value");
scanf("%d",&s);
printf("\n Enter End Value");
scanf("%d",&e);
if (o==1)
{ if (s%2!=0)
{ s++; } }
if (o==2)
{ if (s%2==0)
{ s++; }}
for (a=s;a<=e;a++,a++)
printf("\n The loop is %d", a);
getch();
}
#include
void main()
{
clrscr();
int a,e,s,o;
printf("For Even Nos type 1 and for ODD Nos type 2");
scanf("%d",&o);
printf("\n Enter starting value");
scanf("%d",&s);
printf("\n Enter End Value");
scanf("%d",&e);
if (o==1)
{ if (s%2!=0)
{ s++; } }
if (o==2)
{ if (s%2==0)
{ s++; }}
for (a=s;a<=e;a++,a++)
printf("\n The loop is %d", a);
getch();
}
Comments