Saturday, 22 July 2017

Print the Sequence [8 12 17 24 28 33 Upto 100]

Print the Sequence [8  12  17  24  28  33 Upto 100].

Write a C program to go into any number from user and print all even numbers among 1 to n using while loop. C program to show even wide variety in a given range the use of while loop. The way to generate even numbers from 1 to n the use of while loop in C programming.

Code:


#include<stdio.h>
#include<conio.h>
void main()
{
 int a=8;
 while(a<=100)
 {
 printf("%d ",a);
 a+=4;
 printf("%d ",a);
 a+=5;
 printf("%d ",a);
 a+=7;
 }
 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