JOIN us on
WhatsApp Group Join Now
Telegram Join Join Now

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

Class 6

Hindi social science science maths English

Class 7

Hindi social science science maths English

Class 8

Hindi social science science maths English

Class 9

Hindi social science science Maths English

Class 10

Hindi Social science science Maths English

Class 11

Hindi sociology physics physical education maths english economics geography History

chemistry business studies biology accountancy political science

Class 12

Hindi physics physical education maths english economics

chemistry business studies biology accountancy Political science History sociology

Home science Geography

English medium Notes

Class 6

Hindi social science science maths English

Class 7

Hindi social science science maths English

Class 8

Hindi social science science maths English

Class 9

Hindi social science science Maths English

Class 10

Hindi Social science science Maths English

Class 11

Hindi physics physical education maths entrepreneurship english economics

chemistry business studies biology accountancy

Class 12

Hindi physics physical education maths entrepreneurship english economics

chemistry business studies biology accountancy

Categories: c++ language in hindi

write a program to calculate notes in the amount , check valid entry or sides of the triangle c++ language

इससे से पहले के article मे पैटर्न के उदाहरनो को discuss किया था | अब इस article मे c++ language मे कुछ और उदाहरनो को discuss करेगे जिससे आप सभी c++ language के syntax मे बहुत ही अच्छे होते है |

1.Program 1
write a program to calculate notes in the amount.

Expalnation
सबसे पहले यूजर द्वारा amount को input करता है |
इसके बाद यूजर द्वारा declare किये गये amount variable मे assign किया जाता है |
इसमें अलग अलग नोट्स जैसे 500,500,100,50,20,10 आदि के value को hold करता है |
अगर amount की value 2000 से बड़ी होती है तब 2000 की value amount / 2000 statement से calculate किया जाता है | इसके बाद amount को amount – note2000*2000 update किया जाता है |
अगर amount की value 500 से बड़ी होती है तब note500 की value amount / 500 statement से calculate किया जाता है | इसके बाद amount को amount – note500*500 update किया जाता है |
अगर amount की value 50 से बड़ी होती है तब note50 की value amount / 50 statement से calculate किया जाता है | इसके बाद amount को amount – note50*50 update किया जाता है |
अगर amount की value 100 से बड़ी होती है तब note की value amount / 100 statement से calculate किया जाता है | इसके बाद amount को amount – note100*100 update किया जाता है |
अगर amount की value 200 से बड़ी होती है तब note200 की value amount / 200 statement से calculate किया जाता है | इसके बाद amount को amount – note200*200 update किया जाता है |
अगर amount की value 20 से बड़ी होती है तब note20 की value amount / 20 statement से calculate किया जाता है | इसके बाद amount को amount – note20*20 update किया जाता है |

#include<iostream.h>
#include<conio.h>
void main()
{
int amount ;
int note2000,note500,note200,note100,note20,note50;
cout<<“Enter Amount : “<<endl;
cin>>amount;
if(amount>2000)
{
note2000=amount/2000;
amopunt = amount – note2000*2000;
}
if(amount>2000)
{
note2000=amount/2000;
amopunt = amount – note2000*2000;
}
if(amount>500)
{
note500=amount/500;
amopunt = amount – note500*500;
}
if(amount>200)
{
note200=amount/200;
amopunt = amount – note200*200;
}
if(amount>100)
{
note100=amount/100;
amopunt = amount – note100*100;
}
if(amount>50)
{
note50=amount/50;
amopunt = amount – note50*50;
}
cout<<“Note od Rs 2000 : “<<note2000<<endl;
cout<<“Note od Rs 500 : “<<note500<<endl;
cout<<“Note od Rs 200 : “<<not200<<endl;
cout<<“Note od Rs 100 : “<<note100<<endl;
cout<<“Note od Rs 50 : “<<note50<<endl;
getch();
}

2.Program 2
write a program to check valid entry or sides of the triangle.

Explanation
सबसे पहले यूजर द्वारा sides value को input करता है |
इसके बाद यूजर द्वारा declare किये गये variable a,b or c मे assign किया जाता है |
इसके बाद इन variable को function check() मे pass किया जाता है |
check() function से return किये गये value को count मे assign किया जाता है |
अगर count की value ‘1’ होती है तब sides are not perfect display होगा |
अगर count की value ‘0’ होती  है तब sides are perfect display होगा |
check() मे ,
इस function मे तीन conditions को check किया जाता जाता है |
अगर (a+b>c) और (a+c>b) और ( b+c>a) check किया जाता है |
अगर तीनो conditions true होगी तब count की value ‘0’ होगी | अन्यथा count = 1 होगी |

#include<iostream.h>
#include<conio.h>
int check(int , int ,int );
void main()
{
int a,b,c;
cout<<“Enter side1 :”<<endl;
cin>>a;
cout<<“Enter side2 :”<<endl;
cin>>b;
cout<<“Enter side3 :”<<endl;
cin>>c;
int count = check(a,b,c);
if(count==1)
{
cout<<“sides are perfect”;
}
else
{
cout<<“sides are not perfect”.<<endl;
}
getch();
}
int check(int p,int q,int r)
{
if((p+q>r) && (p+r>q) && (q+r>p))
{
count = 0;
}
else{
count =1;
}
return count;
}

3.Program 3
write a program to check valid entry or angles of the triangle.

Expalnation
सबसे पहले यूजर द्वारा angles value को input करता है |
इसके बाद यूजर द्वारा declare किये गये variable a,b or c मे assign किया जाता है |
इसके बाद इन variable को function check() मे pass किया जाता है |
check() function से return किये गये value को count मे assign किया जाता है |
अगर count की value ‘1’ होती है तब angles are not perfect display होगा |
अगर count की value ‘0’ होती  है तब angles are perfect display होगा |
check() मे ,
इस function मे तीन conditions को check किया जाता जाता है |
अगर (a+b+c ==180) को  check किया जाता है |
अगर तीनो conditions true होगी तब count की value ‘0’ होगी | अन्यथा count = 1 होगी |

#include<iostream.h>
#include<conio.h>
int check(int , int ,int );
void main()
{
int a,b,c;
cout<<“Enter angle1 :”<<endl;
cin>>a;
cout<<“Enter angle2 :”<<endl;
cin>>b;
cout<<“Enter angle3 :”<<endl;
cin>>c;
int count = check(a,b,c);
if(count==1)
{
cout<<“angles are perfect”;
}
else
{
cout<<“angles are not perfect”.<<endl;
}
getch();
}
int check(int p,int q,int r)
{
if(p+q+r == 180 )
{
count = 0;
}
else{
count =1;
}
return count;
}

4.Program 4
write a program to calcualate loss और profit.

Expalnation
सबसे पहले यूजर द्वारा  दो value को input करता है |
इसके बाद यूजर द्वारा declare किये गये variable sell_price और cost_price मे assign किया जाता है |
उसके बाद  sell_price और cost_price को check किया जाता है |
अगर sell_price की value cost_price से बड़ी होती है तब profit = sell_price – cost_price को calculate किया जाता है |
अगर sell_price की value cost_price से छोटी  होती है तब profit = cost_price – sell_price को calculate किया जाता है |
इसके बाद  profit और loss की value को print करते है |

#include<iostream.h>
#include<conio.h>
void main()
{
int a,b;
cout<<“Enter cost price :”<<endl;
cin>>a;
cout<<“Enter sell price  :”<<endl;
cin>>b;
if(a>b)
{
int loss = a-b;
cout<<“loss :”<<loss;
}
if(a<b)
{
int profit = b-a;
cout<<“Profit : “<<profit;
}
getch();
}

Sbistudy

Recent Posts

four potential in hindi 4-potential electrodynamics चतुर्विम विभव किसे कहते हैं

चतुर्विम विभव (Four-Potential) हम जानते हैं कि एक निर्देश तंत्र में विद्युत क्षेत्र इसके सापेक्ष…

20 hours ago

Relativistic Electrodynamics in hindi आपेक्षिकीय विद्युतगतिकी नोट्स क्या है परिभाषा

आपेक्षिकीय विद्युतगतिकी नोट्स क्या है परिभाषा Relativistic Electrodynamics in hindi ? अध्याय : आपेक्षिकीय विद्युतगतिकी…

3 days ago

pair production in hindi formula definition युग्म उत्पादन किसे कहते हैं परिभाषा सूत्र क्या है लिखिए

युग्म उत्पादन किसे कहते हैं परिभाषा सूत्र क्या है लिखिए pair production in hindi formula…

5 days ago

THRESHOLD REACTION ENERGY in hindi देहली अभिक्रिया ऊर्जा किसे कहते हैं सूत्र क्या है परिभाषा

देहली अभिक्रिया ऊर्जा किसे कहते हैं सूत्र क्या है परिभाषा THRESHOLD REACTION ENERGY in hindi…

5 days ago

elastic collision of two particles in hindi definition formula दो कणों की अप्रत्यास्थ टक्कर क्या है

दो कणों की अप्रत्यास्थ टक्कर क्या है elastic collision of two particles in hindi definition…

5 days ago

FOURIER SERIES OF SAWTOOTH WAVE in hindi आरादंती तरंग की फूरिये श्रेणी क्या है चित्र सहित

आरादंती तरंग की फूरिये श्रेणी क्या है चित्र सहित FOURIER SERIES OF SAWTOOTH WAVE in…

1 week 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