C Program to Check whether the number is Even or Odd|how to find odd and even numbers in c programming|E-studyblog

In this Article, you will learn how to  Check whether the number is Even or odd. We have shared the source code of odd and even number in c program. You can follow this article to get the source code of how to find odd and even numbers in c programming. you can share this article with your friends who all are interested in c programming

C Program to Check whether the number is Even or Odd|
C Program to Check whether the number is Even or Odd

Click on this link below to get some more c programs:



Even number|Odd Number|

An even number is a number which is divided by 2 (two) and has 0 (zero) remainder or no remainder.

Some Examples of even number are :2,4,6,8,10,,,,,,


An odd number is a number which is also divided by 2 (two),but has its remainder or fraction.

Some Examples of odd number are:1,3,5,7,9,11...….


C Program to Check whether the number is Even or Odd|


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
/* C program to check whether a number is Even od Odd */

#include<stdio.h>
int main(){
	int n;
	printf("\nEnter an Integer:");
	scanf("%d",&n);
	if(n%2==0)
	{
		printf("The number is an even number ");
	}
		else
		{
		printf("The number is an odd number");
		return 0;
        }
}


Output:

C Program to Check whether the number is Even or Odd|how to find odd and even numbers in c programming|E-studyblog


C Program to Check whether the number is Even or Odd|how to find odd and even numbers in c programming|E-studyblog







I hope you have read our Article C Program to check whether the number is even or oddand  you have collected lots of information from there. If you like the post, then please comment and share among your friends and family. you can write your opinion about my post in the comment box. 


Thank you!




C program to check whether the number is pronic number or heteromecic number or not| Rectangular number in c|E-studyblog

 In this Article, you will learn how to  check whether the number is pronic number or heteromecic number or not. A Pronic Number is a number which is the product of two consecutive number ,i.e., a number of the form n*(n+1).It is  also known as rectangular number,heteromecic number or oblong number).




C program to check whether the number is pronic number or heteromecic number or not|
C program to check whether the number is pronic number or heteromecic number or not|


Pronic Number |Heteromecic Number | Rectangular Number:


A Pronic Number is a number which is the product of two consecutive number ,i.e., a number of the form n*(n+1).It is also  known as rectangular number ,heteromecic number or oblong number .

Pronic number (n)= x*(x+1)

For Example: 6 is a pronic number 

                      2*3=6

                      2*(2+1)=6

Some Pronic numbers are 0, 2, 6, 12, 20, 30, 42, 56, 72, 90, 110, 132, 156, 182, 210, 240, 272, 306, 342, 380, 420, 462 … etc



C program to check whether the number is pronic number or heteromecic number or not|

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/* C program to check whether the number is pronic number or heteromecic number or not */

#include<stdio.h>
#include <stdlib.h>

int main(){
	int i,n,p,flag=0;
	printf("Enter an Integer:");
	scanf("%d",&p);
	for(i=1;i<=p;i++)
	{
	if(i*(i+1)==p)
	{
	flag=1;
	break;
        }
        }
        if(flag==1)
        {

	printf("\n The number is  a pronic number:");
        }
        else
	{
        printf("\n The  number is   not a pronic number:");
	return 0;
}
}

Output:

C program to check whether the number is pronic number or heteromecic number or not| Rectangular number in c|E-studyblog

C program to check whether the number is pronic number or heteromecic number or not| Rectangular number in c|E-studyblog

       

I hope you have read our Article C Program to check whether the number is pronic number or heteromecic number or notand  you have collected lots of information from there. If you like the post, then please comment and share among your friends and family. you can write your opinion about my post in the comment box. 


Thank you!

C program to find the perfect number using while loop| Perfect number in C |E-studyblog

 In this Article, you will learn  C program to find the perfect number using while loop.


C program to find the perfect number using while loop| Perfect number in C |E-studyblog
C program to find the perfect number using while loop| Perfect number in C |E-studyblog




Perfect number :

Perfect number is  a positive number which is equal to the sum of its proper divisors.

For Example: 6 is a perfect number since it is divisible by 1,2 and 3.

Others Perfect numbers are :28,496 Etc


C program to find the perfect number using while loop:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
 /* C program to find the perfect number using while loop */
 
#include <stdio.h> 
int main(){
	int i=1,n,s=0;
	printf("\nEnter an Integer:");
	scanf("%d",&n);

        while(i<n)
	{
		if(n%i==0)
		s=s+i;
		i=i+1;
		
	}

	if(s==n)
	
	printf("%d is a Perfect Number:",n); 
	  
        else 
  
        printf("%d is not the Perfect Number:",n);   
    
        return 0;
}


Output:
C program to find the perfect number using while loop| Perfect number in C |E-studyblog

C program to find the perfect number using while loop| Perfect number in C |E-studyblog










I hope you have read our Article " C Program to find perfect of the number using while loop"and  you have collected lots of information from there.If you like the post,then please comment and share among your friends and family. you can write your opinion about my post in the comment box. 


Thank you!


C program to find the perfect number using for loop| Perfect number in C |E-studyblog

In this Article, you will learn  C program to find the perfect number using for loop.To find the perfect number, first of all, we have to take out all divisors of that given number, then their sum, if  sum is equal to that given number then it is called to be Perfect number.

                 
C program to find the perfect number using for loop|perfect number in c|E-studyblog
C program to find the perfect number using for loop|perfect number in C |E-studyblog

Perfect number :

A Perfect number is  a positive number which is equal to the sum of its proper divisors.

For Example: 6 is a perfect number since it is divisible by 1,2 and 3.

Others Perfect numbers are :28,496 Etc


C program to find the perfect number using for loop:


 /* C program to find the perfect number using for loop */
 
#include <stdio.h> 
int main(){
	int i,n,s=0;
	printf("\nEnter an Integer:");
	scanf("%d",&n);
	for(i=1;i<n;i++)
	{
		if(n%i==0)
		s=s+i;
		
	}
	if(s==n)
	
	printf("%d is a Perfect Number:",n); 
	  
    else   
    printf("%d is not the Perfect Number:",n);   
    
    return 0;
}


    


Output:

C program to find the perfect number using for loop| Perfect number in C |E-studyblog

C program to find the perfect number using for loop| Perfect number in C |E-studyblog





I hope you have read our Article " C Program to find perfect of the number using for loop"and  you have collected lots of information from there.If you like the post,then please comment and share among your friends and family. you can write your opinion about my post in the comment box. 


Thank you!


C Program to print the Factors of the number| Factors program in C|E-studyblog

 C Program to print the Factors of the number| Factors program in C|E-studyblog

In this program,you will learn to print the factors of the number.

                 


C Program to print the Factors of the number| Factors program in C|E-studyblog
C Program to print the Factors of the number| Factors program in C|E-studyblog



What is a factor number?

A Number is said to be factor, when a number divides or multiplies into another number with zero (0) remainder,

Example: Factor of the number 30 are 1,2,3,5,6,10,15,30


Factors program in C|

#include<stdio.h>
void main(){
	int n,i;
	printf("Enter an integer:");
	scanf("%d",&n);
    printf("Factor of the number are:",n);
	for(i=1;i<=n;++i)
	{
		if(n%i==0)
		printf("%d ",i);
	    	
	}
}

Output|
C Program to print the Factors of the number| Factors program in C|E-studyblog



I hope you have read our Article " C Program to print the Factors of the number"and  you have collected lots of information from there.If you like the post,then please comment and share among your friends and family. you can write your opinion about my post in the comment box. 


Thank you!


C Program using Switch case to enter a digit (0-9) and write in words | C Program to accept single digit number and print it in words|E-studyblog

 C Program using Switch case to enter a digit (0-9) and write  in words |C Program to accept single digit number and print it in words|E-studyblog 


In this Program, you will get knowledge about C Program using Switch case to enter a digit (0-9) and write  in words.


C Program using Switch case to enter a digit (0-9) and write  in words
C Program to accept single digit number and print it in words

C Program using Switch case to enter a digit (0-9) and write  in words:


#include <stdio.h>
void  main()
{
   int choice;

   printf("Enter your choice in Digits from 0 - 9 : ");
   scanf("%d",&choice);
   switch(choice)
   {
	 case 0:
	       printf("\nZero");
	       break;
 
	 case 1:
	       printf("\nOne");
	       break;
	case 2:
	       printf("\nTwo");
	       break;
	case 3:
	       printf("\nThree");
	       break;
	case 4:
	       printf("\nFour");
	       break;
	case 5:
	       printf("\nFive");
	       break;
	case 6:
	       printf("\nSix");
	       break;
	case 7:
	       printf("\nSeven");
	       break;
	case 8:
	       printf("\nEight");
	       break;
	case 9:
	       printf("\nNine");
	       break;
	default:
	       printf("\nInvalid choice ");
	       break;
      }
}



Output:

C Program using Switch case to enter a digit (0-9) and write  in words

C Program using Switch case to enter a digit (0-9) and write  in words

I hope you have read our Article " C Program using Switch case to enter a digit (0-9) and write  in words"and  you have collected lots of information from there.If you like the post,then please comment and share among your friends and family. you can write your opinion about my post in the comment box. 


Thank you!

Program to Display Fibonacci series in C using For loop|E-studyblog

 Program to Display Fibonacci series in C using For loop

In this program, you will get knowledge to Display Fibonacci series in C using for loop. 

Program to Display Fibonacci series in C using For loop
 Program to Display Fibonacci series in C using For loop



Fibonacci series in C:

Fibonacci number: A series of number (Fibonacci) in which each number is the sum of the two previous number. Fibonacci series begins with 0(zero),followed by 1 (one).

Example:0,1,1,2,3,5,8,13,21,34

Fibonacci series in C using For loop:


//C program to calculate  the Fibonacci series using for loop
#include <stdio.h>
int main(){
int n,f1=0,f2=1,temp,i;
printf("\nEnter number of Fibonacci series :");
scanf("%d",&n);
for (i=0;i<n;i++)
{
	if(i<=1)
	temp=i;
	else
	{
		temp=f1+f2;
		f1=f2;
		f2=temp;
		
	}
 printf("%d\n",temp);
}
return 0;
}

Output:

Program to Display Fibonacci series in C using For loop

I hope you have read our Article "C  Program to Display Fibonacci series in C using For loop"and  you have collected lots of information from there.If you like the post,then please comment and share among your friends and family. you can write your opinion about my post in the comment box. 


Thank you!


C program to calculate the area and perimeter of a circle,where radius is a input|E-studyblog|

 C program to calculate the area and perimeter of a circle,where radius is a input|E-studyblog|

Welcome to our Blog.Here, I have shared the source code of C program to calculate the Area and Perimeter of a Circle.Share this blog among your friends who all are interested to  learn programming languages.

C program to calculate the area and perimeter of a circle,where radius is a input|E-studyblog|
C program to calculate the area and perimeter of a circle,where radius is a input|E-studyblog|

C program to calculate the area and perimeter of a circle,where radius is a input|

// C program to calculate the area and perimeter of  a circle
#include<stdio.h>

int main(){
	
	int radius;
	float area,perimeter;
	printf("\nEnter the radius:");
	scanf("%d",&radius);
	
	area=3.14*radius*radius;
	printf("\nThe area of the circle is:%f",area);
	return 0;
}

Output:

C program to calculate the area and perimeter of a circle,where radius is a input|E-studyblog|

I hope you have read our Article "C  Program to calculate the area and perimeter of a circle"and  you have collected lots of information from there.If you like the post,then please comment and share among your friends and family. you can write your opinion about my post in the comment box. 


Thank you!

C Program to swap two numbers without using third variable|E-studyblog2021|

 C Program to swap two numbers without using third variable|E-studyblog2021|


In this C-Program,we swap two numbers without using the third variable.We have done this Program by using  (+) and  (-).

     

C Program to swap two numbers without using third variable|E-studyblog2021|
 C Program to swap two numbers without using third variable|E-studyblog2021|


C Program to swap two numbers without using third variable|

// C program to swap the two numbers without using third variable
#include <stdio.h>
int main(){
	int a,b;
	printf("\nEnter the value of x & y\n");
	scanf("%d %d",&a,&b);
	printf("Before Swapping numbers :%d %d\n",a,b);
	 
	 a=a+b;
	 b=a-b;
	 a=a-b;
	 
	 printf("\nAfter Swapping: %d %d\n",a,b);
	 return 0;
}

Output:
C Program to swap two numbers without using third variable|E-studyblog2021|

I hope you have read our Article "C  Program to Swap the two numbers without using third variable|E-studyblog"  and  you have collected lots of information from there.If you like the post,then please comment and share among your friends and family. you can write your opinion about my post in the comment box. 


Thank you!

C Program to Swap (interchange) the Two Numbers with using Third variable|E-studyblog

 C  Program to Swap (interchange) the Two Numbers with using Third variable|E-studyblog

C  Program to Swap (interchange) the Two Numbers with using Third variable

C  Program to Swap (interchange) the Two Numbers with using Third variable|


#include <stdio.h>
int main(){
	double a,b,temp;
	printf("\nEnter first number:");
	scanf("%lf",&a);
	printf("\nEnter the second number");
	scanf("%lf",&b);
	//value of first(a) is assigned to temp
	temp=a;
	//value of second (b)is assigned to first(a)
	a=b;
	//initial value of temp is assigned to second (b)
	b=temp;
	
	printf("\n Swapping of first numbers=%.2lf\n",a);
	printf("\n Swapping of second numbers=%.2lf\n",b);
	
	return 0;	
}



Output:

C  Program to Swap (interchange) the Two Numbers with using Third variable|

I hope you have read our Article "C  Program to Swap (interchange) the Two Numbers with using Third variable|E-studyblog"  and  you have collected lots of information from there.If you like the post,then please comment and share among your friends and family. you can write your opinion about my post in the comment box. 


Thank you!

C Program to find Factorial of the number using For -Loop|E-studyblog|

 C Program to find Factorial of the number using For -Loop|E-studyblog|


C Program to find Factorial of the number using For -Loop|E-studyblog|

                                            C Program to find Factorial of the number using For -Loop|E-studyblog|


Factorial number?

A Factorial is a function that multiplies a number by every number.

For Example:- 
0!=1
1!=1
2!=2*1=2
31=3*2*1=6
4!=4*3*2*1=24
5!=5*4*3*2*1=120

Formula :- n!=n*(n-1)* ....*1

Factorial of the number

#include <stdio.h>
int main()
{
	int n,i,f=1;
	printf("\nEnter the value of n:");
	
        scanf("%d",&n); 
	
	for(i=1;i<=n;i++)
	f=f*i;         
	printf("\nFactorial =%d",f);
}


Output:

C Program to find Factorial of the number using For -Loop|E-studyblog|


I hope you have read our Article  and  you have collected lots of information from there.If you like the post,then please comment and share among your friends and family. you can write your opinion about my post in the comment box. 


Thank you!

C Program to check whether a number is palindrome or not| E-studyblog|

C Program to check whether a number is palindrome or not| E-studyblog|


C Program to check whether a number is palindrome or not E-studyblog
C Program to check whether a number is palindrome or not| E-studyblog|



What is palindrome number ?

An Integer is said to be palindrome if the reverse number remains the  same of that given number.
Example: 1001 is a palindrome number
                1234 is not a palindrome number


C Program to check whether a number is palindrome or not:

#include<stdio.h>
int main(){
	int n,s=0;
	printf("\nEnter the Integers:");
	scanf("%d",&n);
	int k=n;
	while(n>0)
	{

		int d=n%10;
		s=(s*10)+d;
		n=n/10;
		
	}
       //if k and s are equal
	if(k==s)
	printf("\nThe number is palindrome number:");
	else
	printf("\nThe number is not palindrome number:");
	
	return 0;
	
}


OUTPUT:

C Program to check whether a number is palindrome or not E-studyblog

C Program to check whether a number is palindrome or not E-studyblog





I hope you have read our Article  and  you have collected lots of information from there.If you like the post,then please comment and share among your friends and family. you can write your opinion about my post in the comment box. Thank you!

C Program to Check whether the number is Even or Odd|how to find odd and even numbers in c programming|E-studyblog

I n this Article, you will learn how to   Check  whether the number is  Even or odd. We have shared the source code of odd and even number i...