Skip to main content

Posts

Showing posts with the label Table till 10

C Program to Print Odd Numbers from 1 to 20- while Loop

In this easy coded program, you will learn how to print odd numbers from 1 to 20 using while loop. You will not need to take any input from the user as we are defining the end point. --------------------------------------------------------------------------- Program to Print Odd Numbers from 1 to 20 /*Odd Numbers from 1 to 20- while Loop*/ #include<stdio.h> void main () {     int i =1 ;     while (i <=20 )         {             printf( "%d \t " , i);             i +=2 ;         } }   Output 1 3 5 7 9 11 13 15 17 19 ---------------------------------------------------------...

C Program to Print Numbers from 1 to 'n' (while Loop)

In this easy coded program, you will learn how to print numbers from 1 up to the end decided by the user using while 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' (while Loop) /*Print Numbers from 1 to n- while loop*/ #include<stdio.h> void main () {     int i, num;     i =1 ;     printf( "Enter Number: " );     scanf( "%d" , & num);     while (i <= num)     {         printf( "%d \t " ,i ++ );     } } Output Enter Number : 7 1 2 3 4 5 6 7 ------...

C Program to Print Table till 10

In this easy coded program, you will learn how to print table till 10. You will not have to take any input from the user for this program. Similarly, you can print table till any number by minor modifications in this program. Try doing them for self practice. --------------------------------------------------------------------------- Program to Print Table till 10 /*Table till 10*/ #include<stdio.h> void main () {     int num, i, j, a;     j =1 ;     while (j <=10 )     {             for (i =1 ; i <=10 ; i ++ )         {             a = j * i;        ...