WhatsApp Group Join Now
Telegram Join Join Now

Decision Making Statements : Most Important Examples in hindi डिसीजन मेकिंग स्टेटमेंट

डिसीजन मेकिंग स्टेटमेंट Decision Making Statements : Most Important Examples in hindi in c computer language :-
C language के सबसे महत्वपूर्ण 8 प्रोग्राम को इस article मे लिखा गया है |सबसे पहले इन प्रोग्राम को खुद try करेगे |बाद में इसके solved code देखे|

1.find a number is even or not.
2.find a number is odd or not.
3.find a number is Armstrong or not.
4.find a number is prime or not.
5.find a simple interest.
6.find a area of circle from radius.
Answer :
Solution 1 : Code for find a number is even or not.
#include<conio.h>
#include<stdio.h>
void main ()
{
int num ;
printf(“Enter The Number”);
scanf(“%d”,&num);
if ((num/2)==0)
{
printf(“Number is Even .”);
}
printf(“Number is not Even.”);
getch();
}


Solution 2 : Code for find a number is odd or not.

#include<conio.h>
#include<stdio.h>
void main ()
{
int num ;
printf(“Enter The Number”);
scanf(“%d”,&num);
if ((num/2)!=0)
{
printf(“Number is odd.”);
}
printf(“Number is not odd.”);
getch();
}


Solution 3:Code for find a number is Armstrong or not.

#include<conio.h>
#include<stdio.h>
void main ()
{
int num,i,sum ;
printf(“Enter The Number”);
scanf(“%d”,&num);
int t=num;
for(i=num%10;num!=0;num=num/10)
{
      temp= i*i*i;
      sum=sum+temp;
 }
if (t==sum)
{
printf(“Number is Armstrong.”);
}
else
{
printf(“Number is not Armstrong.”);
}
getch();
}

Code 4: code for find a number is prime or not.

#include<conio.h>
#include<stdio.h>
void main ()
{
int num,i ;
int j=0;
printf(“Enter The Number”);
scanf(“%d”,&num);
for(i=1;i<num;i++)
{
if (num%i==0)
{
j++;
}
}
if(j==2)
{
printf(“Number is prime number”);
}
else
{
printf(“Number is not prime number”);
}
}


Code 5: Find Simple Interest.

#include<conio.h>
#include<studio.h>
void main()
{
float SI;
int principal;
int rate;
int time;
printf(“Enter your principal”);
scanf(“%d”,&principal);
printf(“Enter your rate”);
scanf(“%d”,&rate);
printf(“Enter your time”);
scanf(“%d”,&time);
SI=(principal*rate*time)/100
printf(“Simple Interest=%f”,SI);
getch();
}

Code 6:Find area of circle.

#include<conio.h>
#include<studio.h>
#define pi 22.7
void main()
{
float area;
int r;
printf(“Enter your radius”);
scanf(“%d”,&r);
area=pi*r*r;
printf(“Area=%f”,area);
getch();
}