Computer Science, asked by ricky141087, 1 year ago

write a program to print the following series 3 6 9 12 15 till 10 terms

Answers

Answered by Disha234
27
class xyz
{
public void disp()
{int i;
for(i=3,i<33,i+=3)
System.out.println(i);
}
}

Answered by GulabLachman
16

A C program to print the following series 3 6 9 12 15 till 10 terms is shown below.

The series is a representation of the multiples of 3. So, the 10th term is 30.

# include <stdio.h>  

# include <conio.h>

int main()  

{  

int i ;  

int d = 3 ;

int n = 30;  

for(i = 1 ; i <= n ; i++)  

 if(i % d == 0)  

  printf("%d\t", i) ;  

getch() ;  

}

OUTPUT

3 6 9 12 15 18 21 24 27 30

Similar questions