Saturday, 22 July 2017

Print the Sequence [1 3 9 27 81 upto 200]

Print the Sequence [1  3  9  27  81  Upto 200].

Write a C program to enter any quantity from person and print all even numbers among 1 to 200 the use of whilst loop. C application to show even range in a given variety the usage of even as loop. How to generate even numbers from 1 to n using even as loop in C programming.

Code:


#include<stdio.h>
#include<conio.h>
void main()
{
 int n;
 for(n=1;n<=200;n=n*3)
 {
 printf("%d ",n);
 }
 getch();
 clrscr();
}

Output:


Try it yourself.
If you have any problem you can tell me on comment box i will help you.
thanks.

Viral Programs

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation.

0 comments:

Post a Comment