सीधे मुख्य सामग्री पर जाएं

Featured Post

Types of Images or Subsets of Computer Graphics in hindi

conditional statement in hindi | conditional statement examples

 आज हम conditional statement in hindi और conditional statement examples के बारे में जानेगे क्या होता हैconditional statement in hindi तो चलिए शुरु करते हैं:-

conditional statement in hindi:-

कभी - कभी ऐसे प्रोग्राम भी बनाए जाते हैं जिनमें आउटपुट दो प्रकार का होता है । यह आउटपुट किसी कंडीशन पर निर्भर करता है । कंडीशन के सही या : गलत होने पर आउटपुट अलग - अलग होते हैं । कंडीशन के सही होने पर सही वाले ब्लॉक का आउटपुट प्रदर्शित होगा , वही कंडीशन के गलत होने पर गलत वाले ब्लॉक का आउटपुट प्रदर्शित होगा । 
types of conditional statement:-

( i ) if statement in c in hindi 
( ii ) Do case 

(i) if statement in hindi: -

यह एक conditional statement  है । इसके अन्तर्गत एक या एक से अधिक कंडीशन्स को लिखा जा सकता है । एक ही स्टेटमेन्ट में एक से अधिक कंडीशन्स के लिए लॉजिकल ऑपरेटर्स का प्रयोग किया जाता है । एक या दो प्रकार की कंडीशन्स के लिए if ....... else ....... end if का प्रयोग किया जाता है तथा अलग - अलग प्रकार की कंडीशन्स को nested if के द्वारा लिखा जा सकता है । nested if में if के अन्दर एक और if को लिखा जाता है । इसका Syntax हैं  : 

( a ) Syntax of if ....... else ........ endif

If <condition >
               <Statements>
else 
              <Statements>
ended
if statement in c in hindi



If statment Example: Write a program to input age from the user and chck the user is eligible for voting or not. 
Set Talk off 
Clear 
Store 0 to a 
input "Enter your age " to a 
if a >= 18 
            ? "Eligible for voting" 
else  
            ? "Not eligible for voting" 
endif 
 Set Talk on 
Output- 
Enter your age 17 
Not eligible for voting 

(b) Syntax of Nested if :- Method - 1

if< Condition 1>
                 if <Cordition 2>
                  <Statement>
Else
                  <Statement>
Endif 
                 <Statement>
Else
                 <Statement>
Endif

Syntax of Nested if :- Method -2 

if < Condition 1> 
              <Statement> 
Else 
               if <Condition 2> 
                            <Statement> 
               Else  
                            <Statement>
Endif 
Endif
conditional statement in hindi | conditional statement examples



If statement Example :- Accept Post from User and Print salary according to the following :- 
(i) if Post is Manager Sal = 20,000/- 
(ii) if Post is Executive Sal = 10,000/- 
(iii) if Post is Trainee Sal = 7000/-
Set Talk off 
Clear 
store null to p 
Accept "Enter Your Post " to P

if upper (P) = "MANAGER"
? "Salary is 20,000" 
else 
   if upper (P) = "EXECUTIVE" 
                ? "Salary is 10,000" 
else 
                 if upper (P) = "TRAINEE" 
                                 ? "Salary is 7,000"
else 
                                 ? "Wrong Post" 
                      Endif 
          Endif 
Endif 
Set talk on
Output 
Enter Your Post executive 
Salary is 10000

Do case ....... end case:-

यह स्टेटमेन्ट Multiway स्टेटमेन्ट है । इसमें दिए गए इनपुट को प्रोग्राम में लिखे गए Case से मिलाया जाता है । कन्डीशन का मिलान जिस Case से हो जाता है । उस Case में लिखे स्टेटमेन्ट एक्जीक्यूट हो जाते हैं । इसका सिन्टैक्स इस प्रकार है: 

Syntax:-       Do Case

                                       Case <Condition 1>                                                              <Satement> 
                                       Case <Condition 2>                                                               <Satement>  
                                       Case <Condition 3>                                                               <Satement> 
                                       Case n... 
                        otherwise 
                                        <Statement>
                         End case
conditional statement in hindi | conditional statement examples



Example :- Write a program which takes number from 1 to 5 and print this number in a character format 
Set talk off
Clear
Store 0 to num 
Input "Enter a Number " to num
Do Case
      Case num = 1
                  a = "one
      Case num = 2 
                  a = "two"
      Case num = 3
                  a = "three"
      Case num = 4
                  a = "four"
      Case num = 5
                  a = "five"
Otherwise 
    ? "Number is Not Between 1 to 5"
EndCase 
     ? "Character format of your number is - ",a
Set talk on
Output :-
Enter a Number 3
Character format of your number is - three


टिप्पणियाँ

इस ब्लॉग से लोकप्रिय पोस्ट

ms excel functions in hindi

  आज हम  computer in hindi  मे ms excel functions in hindi(एमएस एक्सेल में फंक्शन क्या है)   -   Ms-excel tutorial in hindi   के बारे में जानकारी देगे क्या होती है तो चलिए शुरु करते हैं- ms excel functions in hindi (एमएस एक्सेल में फंक्शन क्या है):- वर्कशीट में लिखी हुई संख्याओं पर फॉर्मूलों की सहायता से विभिन्न प्रकार की गणनाएँ की जा सकती हैं , जैसे — जोड़ना , घटाना , गुणा करना , भाग देना आदि । Function Excel में पहले से तैयार ऐसे फॉर्मूले हैं जिनकी सहायता से हम जटिल व लम्बी गणनाएँ आसानी से कर सकते हैं । Cell Reference में हमने यह समझा था कि फॉर्मूलों में हम जिन cells को काम में लेना चाहते हैं उनमें लिखी वास्तविक संख्या की जगह सरलता के लिए हम उन सैलों के Address की रेन्ज का उपयोग करते हैं । अत : सैल एड्रेस की रेन्ज के बारे में भी जानकारी होना आवश्यक होता है । सैल एड्रेस से आशय सैल के एक समूह या श्रृंखला से है । यदि हम किसी गणना के लिए B1 से लेकर  F1  सैल को काम में लेना चाहते हैं तो इसके लिए हम सैल B1 , C1 , D1 , E1 व FI को टाइप करें या इसे सैल Address की श्रेणी के रूप में B1:F1 टाइ

window accessories kya hai

  आज हम  computer in hindi  मे window accessories kya hai (एसेसरीज क्या है)   -   Ms-windows tutorial in hindi   के बारे में जानकारी देगे क्या होती है तो चलिए शुरु करते हैं- window accessories kya hai (एसेसरीज क्या है)  :- Microsoft Windows  कुछ विशेष कार्यों के लिए छोटे - छोटे प्रोग्राम प्रदान करता है इन्हें विण्डो एप्लेट्स ( Window Applets ) कहा जाता है । उनमें से कुछ प्रोग्राम उन ( Gadgets ) गेजेट्स की तरह के हो सकते हैं जिन्हें हम अपनी टेबल पर रखे हुए रहते हैं । कुछ प्रोग्राम पूर्ण अनुप्रयोग प्रोग्रामों का सीमित संस्करण होते हैं । Windows में ये प्रोग्राम Accessories Group में से प्राप्त किये जा सकते हैं । Accessories में उपलब्ध मुख्य प्रोग्रामों को काम में लेकर हम अत्यन्त महत्त्वपूर्ण कार्यों को सम्पन्न कर सकते हैं ।  structure of window accessories:- Start → Program Accessories पर click Types of accessories in hindi:- ( 1 ) Entertainment :-   Windows Accessories  के Entertainment Group Media Player , Sound Recorder , CD Player a Windows Media Player आदि प्रोग्राम्स उपलब्ध होते है

report in ms access in hindi - रिपोर्ट क्या है

  आज हम  computers in hindi  मे  report in ms access in hindi (रिपोर्ट क्या है)  - ms access in hindi  के बारे में जानकारी देगे क्या होती है तो चलिए शुरु करते हैं-  report in ms access in hindi (रिपोर्ट क्या है):- Create Reportin MS - Access - MS - Access database Table के आँकड़ों को प्रिन्ट कराने के लिए उत्तम तरीका होता है , जिसे Report कहते हैं । प्रिन्ट निकालने से पहले हम उसका प्रिव्यू भी देख सकते हैं ।  MS - Access में बनने वाली रिपोर्ट की मुख्य विशेषताएँ :- 1. रिपोर्ट के लिए कई प्रकार के डिजाइन प्रयुक्त किए जाते हैं ।  2. हैडर - फुटर प्रत्येक Page के लिए बनते हैं ।  3. User स्वयं रिपोर्ट को Design करना चाहे तो डिजाइन रिपोर्ट नामक विकल्प है ।  4. पेपर साइज और Page Setting की अच्छी सुविधा मिलती है ।  5. रिपोर्ट को प्रिन्ट करने से पहले उसका प्रिन्ट प्रिव्यू देख सकते हैं ।  6. रिपोर्ट को तैयार करने में एक से अधिक टेबलों का प्रयोग किया जा सकता है ।  7. रिपोर्ट को सेव भी किया जा सकता है अत : बनाई गई रिपोर्ट को बाद में भी काम में ले सकते हैं ।  8. रिपोर्ट बन जाने के बाद उसका डिजाइन बदल