E-mail : gbloggers30@gmail.com
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.