Saturday, 28 April 2018

Program To Print First n Even Number in C Languages

/* print first n even number */
# include <stdio.h>
void main ()
{
int n , a=2 ;
int i=0 ;
clrscr () ;
printf ("/n how many first even no. you want to print :") ;
scanf ("%d", & n) ;
while ( i < n ) 
{
printf ("/n %d", a) ;
a = a + 2 ;
i++ ;
}
getch () ;
}

No comments:

Post a Comment

Featured post

Program to find Volume of given box in java

class volume { public static void main (String args []) { int l=5,b=6,h=10; int volume; volume=l*b*h; System.out.println (" vol...