Skip to main content

SIMPLE HELLO WORLD EXAMPLE IN C LANGUAGE

1. Simple Hello world example
#include<stdio.h> // to include library "stdio.h" 
int main()                    // every c program starts with main function
{
 printf("Hello World"); // printf() function prints whatever is placed within ' "  " '
 return 0;
}

Output: Hello World

Description:
1.First line "#include<stdio.h>" indicates that we want to use stdio.h library in our code.
2.int main() - all code is written in this block. "int" return type is integer.
3.printf("Hello World"); - to write a "hello world" message on console
How to run and execute: 
Step 1 : Type this code in your turbo c compiler and save it with appropriate file name (ex: helloWorld.c).
Step 2 :Click compile -> compile
Step 3 :Click run ->run
Step 4 :Press alt+x to exit from turbo C and see the output.
Step 5 :To continue with your code type "tc" again.
In marathi language / मराठीत वर्णन
1.तुमच्या turbo c कॉम्पिलेर मध्ये हा कोड लिहा .
2.compile -> compile वर क्लिक करा.
3.run - > run वर क्लिक करा.
4.उत्तर साठी alt + x type करा. मग पोइन्तेर turbo c च्या बाहेर येणार. कॉन्सोले वर तुम्हाला उत्तर दिसेल.
5.परत turbo c वर येण्या करिता कॉन्सोले वर "tc" लिहा.
Code description / कोड चा वर्णन 
पहिली ओळ : #include<stdio.h> - आपल्याला stdio.h ह्या library चा कोड वापरायचा असल्या मुले हि पहिली ओळ .
दुसरी ओळ :int main () - प्रत्येक कोड मध्ये हा मुख्य ब्लोक्क. सगळा मुख्य कोड ह्या ब्लोक्क मध्येच लिहिला जातो.
तिसरी ओळ: printf() - हा function console वर लिहिण्या साठी वापरला जातो.