#include< conio.h>
int main( )
{
int x, r;
clrscr( );
printf("Enter the range:");
scanf("%d",&r);
for(x=1; x <=r; x++)
{
if(x%2==0)
printf("%5d", x);
}
getch( );
return 0;int main( )
{
int x, r;
clrscr( );
printf("Enter the range:");
scanf("%d",&r);
for(x=1; x <=r; x++)
{
if(x%2==0)
printf("%5d", x);
}
getch( );
}
Output:-
Enter the range:10
2 4 6 8 10
No comments:
Post a Comment