Skip to main content

Posts

C Program to Print Even Numbers from 1 to 20 using for Loop

In this easy coded program, you will learn how to print even numbers from 1 to 20 using for loop. --------------------------------------------------------------------------- Program to Print Even Numbers from 1 to 20 using for Loop /*Even Numbers from 1 to 20- for Loop*/ #include<stdio.h> void main () {     int i;     for (i =2 ; i <=20 ; i +=2 )         printf( "%d \t " , i); }   Output 2 4 6 8 10 12 14 16 18 20 --------------------------------------------------------------------------- Hope you found this ' C Program to Print Even Numbers from 1 to 20 using for Loop ' easy, simple and helpful! Try to solve more queries by yourself by referring more examples from BEGINC . Here you will get the mos...

C Program to Print Numbers from b to a using for Loop

In this easy coded program, you will learn how to print numbers from b to a using for loop, where the values of both will be taken from the user. --------------------------------------------------------------------------- Program to Print Numbers from b to a using for Loop /*Print Numbers from b to a- for Loop*/ #include<stdio.h> void main () {     int a, b;     printf( "Enter First Number: " );     scanf( "%d" , & a);     printf( " \n Enter End Number: " );     scanf( "%d" , & b);     for ( ; a >= b; a -- )     {         printf( "%d \t " , a);     } }   Output Enter First Number : 9 Enter End Number : 3 9 8 7 ...

C Program to Print Numbers from a to b using for Loop

In this easy coded program, you will learn how to print numbers from a to b using for loop, where the values of both will be taken from the user. --------------------------------------------------------------------------- Program to Print Numbers from a to b using for Loop /*Print Numbers from a to b- for Loop*/ #include<stdio.h> void main () {     int a, b;     printf( "Enter First Number: " );     scanf( "%d" , & a);     printf( " \n Enter Last Number: " );     scanf( "%d" , & b);     for ( ; a <= b; a ++ )     {         printf( "%d \t " , a);     }   Output Enter First Number : 3 Ent...