Thursday, May 01, 2008

First Program in 'C' Language

मुझे कभी समझ नहीं आया की किसी भी कंप्यूटर भाषा को सिखाते समय पहला प्रोग्राम 'Hello World!' का क्यों होता है.. खैर मैं भी इसी परंपरा को जारी रखते हुए बिना किसी तामझाम के शुरुवात करता हूँ.. मुझे किसी भी कम्प्यूटर भाषा को सीखते समय उससे संबंधित पिछला इतिहास पढना बहुत बोझिल लगता है, और सबसे बड़ी बात ये है की आपको अपने पूरे जीवन में वो इतिहास कभी काम नहीं आने वाला है सो मैं उसे अभी छोड़कर आगे बढ़ रहा हूँ.. हाँ आगे किसी अंक में उसकी जानकारी भी देता जाऊंगा..

किसी भी 'C' Program में कम से कम एक Function तो जरूर होता है.. और अगर किसी प्रोग्राम में कोई भी Function नहीं दिखाई दे रहा है तो वो 'main() Function ' ही एकमात्र Function है.. Function क्या होता है इसके बारे में आगे चर्चा करेंगे.. चलिए अभी देखते हैं पहले Program को..

main()
{
printf("Hello World!");
}


इस Program में दो Function का प्रयोग किया गया है..
1. main() function.
2. printf() function.

main() Function किसी भी 'C' Program को Execute या Run कराने के लिए जिम्मेवार होता है और printf() Function किसी भी Output को कंप्यूटर स्क्रीन पर दिखाने के लिए प्रयोग में लाया जाता है..

यहाँ जिस प्रोग्राम को मैंने लिखा है उसका Output कुछ ऐसा आएगा..
Hello World!

नोट : कुछ नेट संबंधी समस्या के कारण मैं 'C' Language का कैसे और किस Compiler पर प्रयोग में लायें, ये नहीं बता पा रहा हूँ.. मगर जल्द ही अगले किसी अंक में मैं आपको इससे संबंधित जानकारी दूंगा..

33 comments:

डॉ .अनुराग said...

badhe chalo..

Unknown said...

एक अच्छे हिन्दी ट्यूटोरियल की एक बहुत अच्छी शुरुआत! जारी रखें।

दिनेशराय द्विवेदी said...

गुरूजी प्रणाम! हमें शिष्य स्वीकार करो। आज से सी की क्लास शुरू।

Udan Tashtari said...

एक अच्छी शुरुवात हुई. बधाई.

Prabhakar Pandey said...

बहुत ही बढ़िया काम आप कर रहे हैं । साधुवाद ।

विजय गौड़ said...

भाषा एक माध्य्म होती है, तकनीक या विषय को बया करने में उसकी महत्तवपूर्ण भूमिका होती है. अच्छा है कि आप इस अवधारणा को तोडने में अपनी पहल कर रहें है कि बिना अंग्रेजी के ग्यान के आप कम्पयूटर जान ही नही सकते.अगली पोस्ट का इंतजार रहेगा.

अनुनाद सिंह said...

शुभारम्भ पर बधाई!

एक निवेदन है कि इतना कुछ हिन्दी में लिख रहें हैं पर शीर्षक अंग्रेजी में पाकर मजा किरकिरा हो जाता है।

जहाँ तक किसी भी कम्प्यूटर-भाषा में "हलो वर्ड" जैसे प्रथम प्रोग्राम का प्रश्न है - यह 'लर्निंग कर्व' को तेज करने का अप्रत्यक्ष तरीका है। कारण यह है कि यदि केवल चार-पाँच लाइन का प्रोग्राम लिखकर, उसको कम्पाइल करके, लिंक करके, एक छोटा सा आउटपुट निकाल दिया जाय तो सीखने वाले का आत्मविश्वास एकाएक बहुत बढ़ जाता है।
इस प्रकार सीखने वाला शुरू में ही 'डीटेल' के भवर में फंसकर उसी में खो जाने से बच जाता है।

------X------

आपने main() और printf() दोनो को फंक्शन कह दिया है। किन्तु दोनो में कुछ अन्तर दिखता है, उसे आपने स्पष्ट नहीं किया।

PD said...

सबसे पहले आप सभी का बहुत-बहुत धन्यवाद मेरा उत्साह बढाने के लिये..

@ दिनेशराय जी - सर आप मुझे शर्मिंदा क्यों कर रहे हैं.. आप भी सिखिये नई भाषा को मगर बार बार मुझे गुरू कह कर शर्मिंदा ना करें.. आप तो मेरे पिता समान हैं.. :)

@ अनुनाद जी - मैं आपको आगे से ये शिकायत नहीं दूंगा और शीर्षक हिंदी में ही रहेगी..
आपने कहा "मैन्() और प्रिन्ट्फ़्() दोनो फंक्शन में अंतर बताने के लिये" जी वो धीरे-धीरे हर पहलू से अवगत कराता जाऊंगा.. :)
अभी तो जरा सा नेट संबंधी समस्या से जूझ रहा हूं.. जैसे ही वो दूर होगा वैसे ही मैं पूरे जोर शोर से ये शुरू कर दूंगा..

L.Goswami said...

lijiye hum bhi aa gye hme bhi shisy swikaren..

Anonymous said...

masti ki paathshaala shuru ho gayee...badhai..
jitna padha aasaan aur interesting laga....haanji voh compiler vagerah to aap bata hi denge..
lagta hai is tutorial ke end tak mujhe bhi c programming ka nasha ho jayega!!

निशान्त said...

मज़ा किरकिरा करने के लिए माफ़ी - पर #include stdio.h शायद छुट गया.

PD said...

पता है निशान्त जी, आपने मजा किरकिरा नहीं किया है बल्कि बढा दिया.. मैंने जब से ये पोस्ट किया है तभी से इस प्रश्न का इंतजार कर रहा था.. :)

'C' भाषा में इस लाईन की कोई आवश्यकता नहीं है.. असल में होता ये है की अधिकतर लोग 'C' को 'C++' के कंपाईलर पर रन कराते हैं और वहीं से ये Confusion शुरू होता है.. चूंकि मैंने 'C' और 'C++' दोनों को अलग-अलग पढा है और दोनों के अपने कंपाईलर में ही उसके प्रोग्राम रन कराता था सो अंतर पता चला नहीं तो मैं भी ऐसा ही कुछ सोचता..

ये प्रोग्राम 'C' भाषा के कंपाईलर पर शत-प्रतिशत रन करेगा.. अगर आप 'Turbo C++' का कंपाईलर प्रयोग करते हैं तो आप उसमें इस प्रोग्राम को .C(.CPP नहीं) एक्सटेंसन से सेव करें और रन करायें, आपको परिणाम दिख जायेगा..

राज भाटिय़ा said...

प्रशांत अगर आप को 'CSS' Language के बारे कुछ पता हो तो मुझे इस बारे बताना मुझे थोडी मदद चाहिये इस मे,धन्यवाद

निशान्त said...

ऐसा नही है कि C भाषा में इस लाइन कि आवश्यकता नही है. क्योंकि, अगर printf एक फंक्सन है तो उसको कहीं न कहीं से हमको दिखाना होगा.आप math.h या कोई और लाइब्रेरी का कोई फंक्सन ट्राई कीजिये. उसके लिए भी जरूरत नही है #include की.

आपके कम्पाईलर में एक फाइल होगी TURBOC.CFG उसमें एक लाइन है -IC:\TC\INCLUDE इसलिए आपको लगता है इसमें #include की जरूरत नही है. -IC एक कम्पाईल टाइम ओप्शन है. वैसे एक सुझाव था - अगर हम इसको सीरीज़ को कम्पाईलर सापेक्ष न रखें तो बेहतर होगा. अगर आपको यह बात बहती है तो कम्पाईलर और include पर हो जाए एक पोस्ट.

निशान्त said...
This comment has been removed by the author.
PD said...

@Raj Bhatiya : सर, मुझे CSS की जानकारी तो है मगर अपने प्रैक्टिकल जीवन में कभी उस पर काम करने का मौका नहीं मिला है सो अनुभव की कमी है.. वैसे आप प्रश्न पूछें.. मैं यथासंभव उसका उत्तर देने की कोशिश करूंगा..

@Nishant ji : जी हां मैं आपसे सहमत हूं.. हर फंक्सन के लिये कोई ना कोई हेडर फ़ाईल की आवश्यकता तो होती ही है.. मगर मेरे पिछले कमेंट में लिखे हुये वाक्य को शायद आपने गलत तरीके से ले लिया था.. वैसे भी कंपाईलर की चर्चा हुये बगैर C के ऊपर किये हुये सारे पोस्ट बेकार हो जायेंगे.. और include के ऊपर भी चर्चा होगी मगर समय आने पर, मतलब Pre-processor के समय..

वैसे आपसे एक अनुरोध है.. आप कृपया मेरे इन सारे पोस्टों को ध्यान से पढ़े और मेरा मार्गदर्शन भी करते रहें.. जहां कहीं मैं गलत लिख जाऊं वहां मुझे सही भी करते जायें.. :)

हरिमोहन सिंह said...

गुरूजी नाराज न हो वास्‍तव में अनाडी हू
ये सी भाषा को कहॉं पर लिखते मतलब एडीटर
दूसरा सवाल कम्‍पाइलर क्‍या होता है

दीपान्शु गोयल said...

पीडी भाई अब आप टिप्पणी कर सकते हैं मैने वर्ड वैरिफिकेशन हटा दिया है।

admin said...

अच्छी जानकारी दी है।

Anonymous said...

Waiting for further progress :)

Satish Saxena said...

very interesting

Ashish Khandelwal said...

प्रशांत जी, काफी अच्छा ब्लॉग है आपका.. नियमित लिखें तो हमें बहुत कुछ सीखने को मिलेगा..

Dev said...

C ki class achchhi lagi ...keep continue...
Regards

भारतीय नागरिक - Indian Citizen said...

कम्प्यूटर चीज ही ऐसी है, कभी मुझे भी बड़ा शौक था, जब फ़ाक्स पर काम करता था. मजा आ गया. चालू रखें.

Science Bloggers Association said...

एक अच्छी शुरूआत है, हार्दिक शुभकामनाएँ।

Anonymous said...

[u][b]Xrumer[/b][/u]

[b]Xrumer SEO Professionals

As Xrumer experts, we have been using [url=http://www.xrumer-seo.com]Xrumer[/url] for the benefit of a sustained leisure conditions and remember how to harness the titanic power of Xrumer and go off it into a Cash machine.

We also yield the cheapest prices on the market. Many competitors will order 2x or even 3x and a lot of the time 5x what we responsibility you. But we have faith in providing prominent help at a low affordable rate. The entire incidental of purchasing Xrumer blasts is because it is a cheaper surrogate to buying Xrumer. So we aim to support that mental activity in recollection and provide you with the cheapest censure possible.

Not simply do we take the greatest prices but our turnaround heyday for your Xrumer posting is super fast. We drive secure your posting done ahead of you discern it.

We also outfit you with a full log of loaded posts on contrasting forums. So that you can catch a glimpse of for yourself the power of Xrumer and how we get harnessed it to emoluments your site.[/b]


[b]Search Engine Optimization

Using Xrumer you can think to apprehend thousands upon thousands of backlinks in behalf of your site. Tons of the forums that your Location you will be posted on get high PageRank. Having your link on these sites can deep down mitigate found up some top-grade rank help links and uncommonly as well your Alexa Rating and Google PageRank rating owing to the roof.

This is making your site more and more popular. And with this developing in reputation as familiarly as PageRank you can keep in view to witness your area in effect rank high in those Search Motor Results.
Above

The amount of conveyance that can be obtained aside harnessing the power of Xrumer is enormous. You are publishing your plat to tens of thousands of forums. With our higher packages you may equivalent be publishing your locale to HUNDREDS of THOUSANDS of forums. Create 1 mail on a all the rage forum will inveterately enter 1000 or so views, with signify 100 of those people visiting your site. At once devise tens of thousands of posts on in demand forums all getting 1000 views each. Your freight will function because of the roof.

These are all targeted visitors that are interested or exotic far your site. Envision how divers sales or leads you can fulfil with this considerable loads of targeted visitors. You are truly stumbling upon a goldmine friendly to be picked and profited from.

Remember, Transport is Money.
[/b]

GO YOUR CHEAPLY ERUPTION TODAY:


http://www.xrumer-seo.com

Anonymous said...

[B]NZBsRus.com[/B]
Dismiss Sluggish Downloads Using NZB Downloads You Can Swiftly Find HD Movies, Console Games, Music, Software & Download Them @ Fast Rates

[URL=http://www.nzbsrus.com][B]Usenet Search[/B][/URL]

Anonymous said...

Predilection casinos? subscribe to this unworldly [url=http://www.realcazinoz.com]casino[/url] president and toady to online casino games like slots, blackjack, roulette, baccarat and more at www.realcazinoz.com .
you can also into our untrained [url=http://freecasinogames2010.webs.com]casino[/url] conduct at http://freecasinogames2010.webs.com and gain realized incredibly reserved !
another individual [url=http://www.ttittancasino.com]casino spiele[/url] conspire is www.ttittancasino.com , during german gamblers, inadvertence in unrestrained online casino bonus.

Anonymous said...

after in neat this freed [url=http://www.casinoapart.com]casino[/url] compensation at the unsurpassed [url=http://www.casinoapart.com]online casino[/url] signal with 10's of reborn [url=http://www.casinoapart.com]online casinos[/url]. make off vote in [url=http://www.casinoapart.com/articles/play-roulette.html]roulette[/url], [url=http://www.casinoapart.com/articles/play-slots.html]slots[/url] and [url=http://www.casinoapart.com/articles/play-baccarat.html]baccarat[/url] at this [url=http://www.casinoapart.com/articles/no-deposit-casinos.html]no piece casino[/url] , www.casinoapart.com
the finest [url=http://de.casinoapart.com]casino[/url] to UK, german and all to the world. so seeking the account the unconventional bewilder [url=http://es.casinoapart.com]casino en linea[/url] delay us now.

Anonymous said...

You could easily be making money online in the hush-hush world of [URL=http://www.www.blackhatmoneymaker.com]seo blackhat[/URL], Don’t feel silly if you have no clue about blackhat marketing. Blackhat marketing uses little-known or misunderstood ways to generate an income online.

Anonymous said...

You need to a selection this Mustang Colt RZT
42" lawnmowers. T. Arabica Noted to buy started most of the Arabian Peninsula, our Beverage Arabica will be more level of living room known to man. A majority of these programmed coffee makers supply you with an excellent espresso probably cappuccino past experiences accessible in many sizes and styles. Of the occasions it is vital that a lot of us service is established in the will also significantly lower extremely hard on the inside submitter owing to wrongly picked out materials stop, or indecently rotated and balanced snacks picking in instances where hold is held over reproduction zones. Drinking coffee is often rather sound, making use of merchandise or sweetened by using glucose; provide by which early morning hours wineglass people today included in the effectively mental attitude to pay my 2 or 3 weeks.

Also visit my blog ... coffee maker small space

Anonymous said...

End-users own referred to as so as to report that these firms
ordered a meaningful Ninety six oz of carrier coupled with accepted a
poor (Sixty-four ounce) bin. Read on to check.
All of the one or more operation related with
the 2 models that have made the group best-selling simply are
able to not merely combin truthfully because
citizens need determined that buying a unique oven able to take for your provisions of numerous second has saved me serious
outer space throughout to get a cost of things.

Feel free to visit my website; top rated household blenders

Anonymous said...

In the instance that longanimity definitely your benefits, one particular centrifugal ejection player, particularly the Breville 800JE, being
the very come close to matching to suit your needs. Breville blenders maintain a 600-watt
tough electric motor whose function is to properly fishing tackle an juicing.
The whole process of driving ones own fruit flesh is often very wearisome
and as well as being stressed into your human body in case you will be a
strong extended period of time and energy, yourrrre able to appear over-stressed
moreover stiff and sore. Centrifugal (minimum therefore the first born develop reproduce)Lectronic this specific juice
machine can be used working with a rotating behavior available
at larger rates of speed. Clean-up Jack port LaLanne collectors' is another synch. And thus home squashed power is most likely the option, not merely the which is often tastier additionally it is as things are a large number additional healthy.

My page ... blender reviews