Skip to main content

Posts

Showing posts with the label Table till 'n'

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 1 to 'n' (for Loop)

In this easy coded program, you will learn how to print numbers from 1 up to the end decided by the user using for loop. You will have to take input of the last number that the user wants to print and simply write the code for its execution. --------------------------------------------------------------------------- Program to Print Numbers from 1 to 'n' (for Loop) /*Print Numbers from 1 to n- for loop*/ #include<stdio.h> void main () {     int i, num;     i =1 ;     printf( "Enter Number: " );     scanf( "%d" , & num);     for (; i <= num; i ++ )     {         printf( "%d \t " ,i);     } }   Output Enter Number : 7 1 2 3 4 5 6 7...

C Program to Print Table till 'n'

In this easy coded program, you will learn how to print table till 'n'. You will have to take input of the number which will tell the compiler up to where it has to print the table(s). --------------------------------------------------------------------------- Program to Print Table till 'n' /*Table till n*/ #include<stdio.h> void main () {     int num, i, j, a;     j =1 ;     printf( "Enter Number: " );     scanf( "%d" , & num);     while (j <= num)     {             for (i =1 ; i <=10 ; i ++ )         {             a = j * i; ...