Showing posts with label c programming. Show all posts
Showing posts with label c programming. Show all posts

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