Skip to main content

CONTACT US

E-mail : gbloggers30@gmail.com

Comments

More Programs

C Program to Calculate Simple Interest Until User Says to Continue

In this easy coded program, you will learn how to calculate simple interest until the user says to continue by taking input of principle amount, number of years, rate of interest  and wish for continuation from the user. Try adding final calculated amount which will include the principle amount plus the calculated simple interest in this program for your self practice. --------------------------------------------------------------------------- Program to Calculate Simple Interest Until User Says to Continue /*Simple Interest Until User says to Continue- do while loop*/ #include<stdio.h> void main () {         float p, n, r, si;         char opt;         do     {         printf( "Enter Principle Amount, No. of Year...

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

In this easy coded program, you will learn how to print odd numbers from 1 to 20 using for loop. --------------------------------------------------------------------------- Program to Print Odd Numbers from 1 to 20 using for Loop /*Odd Numbers from 1 to 20- for Loop*/ #include<stdio.h> void main () {     int i;     for (i =1 ; i <=20 ; i +=2 )         printf( "%d \t " , i); }   Output 1 3 5 7 9 11 13 15 17 19 --------------------------------------------------------------------------- Hope you found this ' C Program to Print Odd 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 most eas...

C Program to Print Odd Numbers from 1 to 'n'- while Loop

In this easy coded program, you will learn how to print odd numbers from 1 to 'n' using while loop. Here, 'n',i.e. the end point will be given by the user and hence we will need to take input of the same. --------------------------------------------------------------------------- Program to Print Odd Numbers from 1 to 'n' /*Odd Numbers from 1 to n- while Loop*/ #include<stdio.h> void main () {     int i =1 , num;     printf( "Enter Number: " );     scanf( "%d" , & num);     while (i <= num)     {         printf( "%d \t " , i);         i +=2 ;     } }   Output Enter Number : 18 1 3 5 ...

C Program for Subtraction of Two Numbers(3 Variables)

In this easy coded program, you will learn how the subtraction of two numbers takes place using three variables. Actually, using less variables is preferred the most wherever possible. Rather, the same program can also be solved using two variables. --------------------------------------------------------------------------- Program for Subtraction of Two Numbers /*Subtraction of Two Numbers using Three Variables*/ #include<stdio.h> void main () {     int a, b, c;     printf( "Enter Two Numbers: " );     scanf( "%d %d" , & a, & b);     c = a - b;     printf( " \n The Subtraction of %d and %d is %d." , a, b, c);     /*You can exclude the step below.*/     printf( " \n i.e. %d-%d=%d" , a, b, c); } ...

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 Even Numbers from 1 to n using for Loop

In this easy coded program, you will learn how to print even numbers from 1 to 'n' using for loop. Here, 'n' is the number up to which the user wants the even numbers to be printed. --------------------------------------------------------------------------- Program to Print Even Numbers from 1 to n using for Loop /*Even Numbers from 1 to n- for Loop*/ #include<stdio.h> void main () {     int i, num;     printf( "Enter Number: " );     scanf( "%d" , & num);     for (i =2 ; i <= num; i +=2 )         printf( "%d \t " , i); }   Output Enter Number : 8 2 4 6 8 --------------------------------------------------------------------------- Hope you found this ' C Program to Print Even Numbers from 1 to n using for...

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; ...

C Program to Find Sum of All Numbers till 'n'

In this easy coded program, you will learn how to find sum of all the numbers till 'n', where n is up to where you want the sum to be calculated. --------------------------------------------------------------------------- Program to Find Sum of Numbers Till 'n' /*Sum of All Numbers till n*/ #include<stdio.h> void main () {     int i, n, sum =0 ;     printf( "Enter Number: " );     scanf( "%d" , & n);     for (i =1 ; i <= n; i ++ )     {         sum = sum + i;     }     printf( "The sum of all the numbers till %d is %d." , n, sum); } Output   Enter Number : 20 The sum of all the numbers till 20 is 210. ----------------------------------------------------------------...

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 Even Numbers from 1 to 20- while Loop

In this easy coded program, you will learn how to print even 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 Even Numbers from 1 to 20 /*Even Numbers from 1 to 20- while Loop*/ #include<stdio.h> void main () {     int i =2 ;     while (i <=20 )     {                 printf( "%d \t " , i);                 i +=2 ;     } }   Output 2 4 6 8 10 12 14 16 18 20 --------------------------------------------------------------...