l will help you learn programming in C Language. The journey will begin
from small programs and will take you to the most complicated ones through the most easiest, simplest and understandable way. Practice yourself by referring
these from BEGINC and become a programming expert!
In this easy coded program, you will learn how to print numbers from a to b using while loop, where the values of both will be taken from the user. --------------------------------------------------------------------------- Program to Print Numbers from a to b using while Loop /*Print Numbers from a to b- while Loop*/ #include<stdio.h> void main () { int a, b; printf( "Enter First Number: " ); scanf( "%d" , & a); printf( " \n Enter Last Number: " ); scanf( "%d" , & b); while (a <= b) { printf( "%d \t " , a); ++ a; } } Output Enter First Number : 3 Enter Last Number : 9 3 4 5 6 7 8 9
Comments
Post a Comment
Please do not comment any spam links in the comment box.