google.com, pub-6167773875660516, DIRECT, f08c47fec0942fa0 Write a program to print n even numbers - 2nd puc computer science

Write a program to print n even numbers

Write a program to print n even numbers

#include<stdio.h>

#include<conio.h>

void main()

{

int n,i=2;

clrscr();

printf("Enter the number: ");

scanf("%d",&n);

do

{

printf("%d,",i);

i=i+2;

}while(i<=n);

printf("\b.");

getch();

}

Output:

Enter the number: 10

2,4,6,8,10.                       

Write a program to print n even numbers Write a program to print n even numbers Reviewed by Vision Academy on December 08, 2021 Rating: 5

No comments:

CheckOut

Powered by Blogger.