Hello guys in this blog we will learn about how can we write a program to find area of circle .
in this platform you will get correct solution with example.You don't need to go to any other platform .
so our question is write a program to find area of circle .lets start....
Before starting code i wanna tell you algorithm of this code :
First time visitors who don't know about coding programming language follow this link after that you can move on next part.
https://hbscomputercourse.blogspot.com/2022/12/c-language-definitionprogramalgorithm.html
EXAMPLE -Write an algorithm to find area of rectangle.
1 Start
2 Input length .width
3 Area = length.width
4 Output area
5 End
must read before write this code whatever write in this code that things are declared in this blog
#include<stdio.h>
#include<conio.h>
void main()
{
int l,b,area;
printf("length and breath");
scanf("%d%d",&l,&b);
area = l*b;
printf("area of rectangle is = % d",area);
getch();
}
lets do it practical -
first of all we include header file which help us to input output then we start main function
in the main function we declare variables and that data types . after that we print a message so that user can understand what will have to do .Then we take input from user .
so we write scanf function .
we use a formula to solve area of rectangle,formula is as follows
area =length and breadth .
then we write printf function to desplay our output on the screen.
in the last we write getch function to to hold our screen .After void main function thats all are written in curly brackets.
-----------------------------------------------------------------------------------------------------------------------------
Hindi translation :
हेलो दोस्तों इस ब्लॉग में हम जानेंगे कि सर्कल का एरिया निकालने के लिए हम प्रोग्राम कैसे लिख सकते हैं।
इस मंच में आपको उदाहरण के साथ सही समाधान मिलेगा। आपको किसी अन्य मंच पर जाने की आवश्यकता नहीं है।
तो हमारा सवाल है वृत्त का क्षेत्रफल ज्ञात करने के लिए एक प्रोग्राम लिखें। आइए शुरू करें...
कोड शुरू करने से पहले मैं आपको इस कोड का एल्गोरिथम बताना चाहता हूं:
पहली बार आने वाले आगंतुक जो कोडिंग प्रोग्रामिंग भाषा के बारे में नहीं जानते हैं, वे इस लिंक का अनुसरण करें उसके बाद आप अगले भाग पर जा सकते हैं।
उदाहरण - आयत का क्षेत्रफल ज्ञात करने के लिए एक एल्गोरिद्म लिखिए।
1 प्रारंभ करें
2 इनपुट लंबाई ,चौड़ाई
3 क्षेत्र = लंबाई,चौड़ाई
4 आउटपुट क्षेत्र
5 अंत
इस कोड को लिखने से पहले अवश्य पढ़ें इस कोड में जो कुछ भी लिखें कि इस ब्लॉग में चीजें घोषित की गई हैं
#शामिल<stdio.h>
#शामिल<conio.h>
शून्य मुख्य ()
{
इंट एल, बी, क्षेत्र;
प्रिंटफ ("लंबाई और सांस");
स्कैनफ़ ("%d%d",&l,&b);
क्षेत्र = एल * बी;
प्रिंटफ ("आयत का क्षेत्रफल =% d", क्षेत्रफल);
गेटच ();
}
इसे व्यावहारिक रूप से करने दें -
सबसे पहले हम हेडर फ़ाइल शामिल करते हैं जो हमें आउटपुट इनपुट करने में मदद करती है फिर हम मुख्य कार्य शुरू करते हैं
मुख्य कार्य में हम चर और उस डेटा प्रकार की घोषणा करते हैं। उसके बाद हम एक संदेश प्रिंट करते हैं ताकि उपयोगकर्ता समझ सके कि उसे क्या करना है। फिर हम उपयोगकर्ता से इनपुट लेते हैं।
इसलिए हम स्कैनफ फंक्शन लिखते हैं।
हम आयत के क्षेत्रफल को हल करने के लिए एक सूत्र का उपयोग करते हैं, सूत्र इस प्रकार है
क्षेत्र = लंबाई और चौड़ाई।
फिर हम स्क्रीन पर अपना आउटपुट दिखाने के लिए प्रिंटफ फंक्शन लिखते हैं।
अंत में हम अपनी स्क्रीन को होल्ड करने के लिए गेटच फंक्शन लिखते हैं। शून्य मेन फंक्शन के बाद सभी कर्ली ब्रैकेट में लिखे जाते हैं।


.png)
Comments
Post a Comment