MCQ Practice competitive and technical Multiple Choice Questions and Answers (MCQs) with simple and logical explanations to prepare for tests and interviews. Write a Program to Print Even and Odd Numbers From 1 To n in C Using While Loop #include Example: 0, 4, 8, etc.Īn odd number is an integer that is not exactly divisible by 2. The discs differ in size and are initially stacked on one of the poles, in order from largest (disc n) at the. In the towers of Hanoi problem, we have three poles and n discs that fit onto the poles. There are four ways to check or print even and odd numbers in C, by using for loop, while loop, if-else, or by creating a function.Īn even number is an integer exactly divisible by 2. For multiples of three print Fizz instead of the number and for the multiples of five print Buzz. Considering we have an integer(N) and we need to print even and odd numbers from 1 to N using a C program. In this tutorial, we are going to see how to write a program to print even and odd numbers from 1 to n in C language using while loop.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |