JOIN us on
WhatsApp Group Join Now
Telegram Join Join Now

हिंदी माध्यम नोट्स

Categories: C Language in hindi

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();
}
Sbistudy

Recent Posts

मालकाना का युद्ध malkhana ka yudh kab hua tha in hindi

malkhana ka yudh kab hua tha in hindi मालकाना का युद्ध ? मालकाना के युद्ध…

4 weeks ago

कान्हड़देव तथा अलाउद्दीन खिलजी के संबंधों पर प्रकाश डालिए

राणा रतन सिंह चित्तौड़ ( 1302 ई. - 1303 ) राजस्थान के इतिहास में गुहिलवंशी…

4 weeks ago

हम्मीर देव चौहान का इतिहास क्या है ? hammir dev chauhan history in hindi explained

hammir dev chauhan history in hindi explained हम्मीर देव चौहान का इतिहास क्या है ?…

4 weeks ago

तराइन का प्रथम युद्ध कब और किसके बीच हुआ द्वितीय युद्ध Tarain battle in hindi first and second

Tarain battle in hindi first and second तराइन का प्रथम युद्ध कब और किसके बीच…

4 weeks ago

चौहानों की उत्पत्ति कैसे हुई थी ? chahamana dynasty ki utpatti kahan se hui in hindi

chahamana dynasty ki utpatti kahan se hui in hindi चौहानों की उत्पत्ति कैसे हुई थी…

1 month ago

भारत पर पहला तुर्क आक्रमण किसने किया कब हुआ first turk invaders who attacked india in hindi

first turk invaders who attacked india in hindi भारत पर पहला तुर्क आक्रमण किसने किया…

1 month ago
All Rights ReservedView Non-AMP Version
X

Headline

You can control the ways in which we improve and personalize your experience. Please choose whether you wish to allow the following:

Privacy Settings
JOIN us on
WhatsApp Group Join Now
Telegram Join Join Now