Before making a program lets know about Simple interest .What is simple Interest?
Simple interest is the interest amount for a particular principal amount of money at some rate of interest .
Simple interest is the based on the principal amount of loan of the first deposit in a saving account.
Simple interest is a method to calculate the amount of interest charged on a sum at a given rate and for given period of time.
Firstly we will write algorithm so that it's a easy to understand.
EXAMPLE-Write a program to find interest
SI= principal*rate*time/100
1 Start
2 Input principal , rate, time
3 SI= principal * rate* time /100
4 Output SI
5 End .
lets start :
#include<stdio.h>
#include<conio.h>
void main()
{
int p,t;
float r,si;
printf("Enter principal");
scanf("%d",&p);
printf("\nEnter rate of interest");
scanf("%f",&r);
printf("\n Enter time ");
scanf("%d",&t);
si = (p*r*t)/100;
printf("\n simple interest = %f",si);
getch();
}
lest do it practical:
Output:
Explanation of above code:
printf(),scanf(), There are 3-3 function of type printf and scanf.
The first printf function is used to show message on the screen to the user.The message is Enter principal.
scanf() function is used to take input from the user whatever value user give to system according to message are taken through a scanf () function
The second printf(),function display message on the screen: Enter rate of interest.
The second scanf(), function is used to taken rate of interest from user that format specifier is %f.
The Third printf(), function display message on the screen: Enter time.
The third scanf(), function is used to time from user that format specifier is %d.
We use formula to find simple interest formula is as follows:SI=(p*r*t)/100;
once again we write printf(), functiion to display our final answer on the screen.In the last we use getch() function to hold our screen.
In this way we can make a program without error .for more clarification see the above image .
--------------------------------------------------------------------------------------------------------------------------
Hindi Translation:
प्रोग्राम बनाने से पहले साधारण ब्याज के बारे में जान लेते हैं। साधारण ब्याज क्या है?
साधारण ब्याज किसी विशेष मूल राशि के लिए ब्याज की कुछ दर पर ब्याज की राशि है।
साधारण ब्याज बचत खाते में पहली जमा राशि के ऋण की मूल राशि पर आधारित होता है।
साधारण ब्याज एक निश्चित दर पर और निश्चित अवधि के लिए किसी राशि पर लगाए गए ब्याज की राशि की गणना करने की एक विधि है।
सबसे पहले हम एल्गोरिदम लिखेंगे ताकि इसे समझना आसान हो।
उदाहरण- रुचि खोजने के लिए एक कार्यक्रम लिखें
एसआई = मूलधन*दर*समय/100
1 प्रारंभ करें
2 इनपुट मूलधन, दर, समय /100
3 एसआई = मूलधन * दर* समय /100
4 आउटपुट एसआई
अंत ।
चलो शुरू करते हैं :
#शामिल<stdio.h>
#शामिल<conio.h>
शून्य मुख्य ()
{
इंट पी, टी;
फ्लोट आर, सी;
प्रिंटफ ("प्रिंसिपल दर्ज करें");
स्कैनफ ("% डी", और पी);
प्रिंटफ ("\ n ब्याज दर दर्ज करें");
स्कैनफ ("% एफ", और आर);
प्रिंटफ ("\ n समय दर्ज करें");
स्कैनफ ("% डी", और टी);
सी = (पी*आर*टी)/100;
प्रिंटफ ("\ n साधारण ब्याज =% f", si);
गेटच ();
}
ऐसा न हो कि यह व्यावहारिक हो:
आउटपुट:
उपरोक्त कोड की व्याख्या:
सबसे पहले हम दो शीर्षलेख फ़ाइलों को शामिल करते हैं फिर हम मुख्य फ़ंक्शन शुरू करते हैं। हमारा प्रोग्राम मुख्य फ़ंक्शन से चलना शुरू करता है। फिर हम घुंघराले ब्रैकेट में घुंघराले ब्रैकेट का उपयोग करते हैं हम चर घोषित करते हैं और फ़ंक्शन लिखते हैं, कार्य निम्नानुसार हैं: -
प्रिंटफ (), स्कैनफ (), प्रिंटफ और स्कैनफ प्रकार के 3-3 कार्य हैं।
उपयोगकर्ता को स्क्रीन पर संदेश दिखाने के लिए पहले प्रिंटफ फ़ंक्शन का उपयोग किया जाता है। संदेश प्रिंसिपल है।
स्कैनफ () फ़ंक्शन का उपयोग उपयोगकर्ता से इनपुट लेने के लिए किया जाता है जो उपयोगकर्ता संदेश के अनुसार सिस्टम को जो भी मूल्य देता है वह स्कैनफ () फ़ंक्शन के माध्यम से लिया जाता है
स्क्रीन पर दूसरा प्रिंटफ (), फ़ंक्शन डिस्प्ले संदेश: ब्याज दर दर्ज करें।
दूसरा स्कैनफ (), फ़ंक्शन का उपयोग उपयोगकर्ता से ब्याज की दर लेने के लिए किया जाता है जो प्रारूप विनिर्देशक% f है।
तीसरा प्रिंटफ (), फ़ंक्शन स्क्रीन पर संदेश प्रदर्शित करता है: समय दर्ज करें।
तीसरे स्कैनफ (), फ़ंक्शन का उपयोग उस उपयोगकर्ता से समय के लिए किया जाता है जो प्रारूप विनिर्देशक% डी है।
हम साधारण ब्याज ज्ञात करने के लिए सूत्र का उपयोग इस प्रकार करते हैं: SI=(p*r*t)/100;
एक बार फिर हम स्क्रीन पर अपना अंतिम उत्तर प्रदर्शित करने के लिए प्रिंटफ (), फ़ंक्शन लिखते हैं। आखिरी में हम अपनी स्क्रीन को होल्ड करने के लिए गेटच () फ़ंक्शन का उपयोग करते हैं।
इस तरह हम बिना किसी त्रुटि के एक प्रोग्राम बना सकते हैं। अधिक स्पष्टीकरण के लिए ऊपर की छवि देखें।
--------------------------------------------------- ------------


.png)
.png)
Comments
Post a Comment