Introduction To C-Language
సి భాషా పరిచయం
మామూలుగా నిజ జీవితం లో మనము ఒకరి అభిప్రాయాలను మరొకరితో పంచుకోవడానికి ఏదైనా ఒక భాష ను ఉపయోగిస్తాము, అదే విధంగా మనము కంప్యూటర్ తో పని చేయించడానికి ఉపయోగించే భాషనే "సి-భాష" అనగా "C- Language" అని అంటారు.
In real life we use any human languages like English, Hindi, Telugu etc... to communicate (talk) with other persons, same as like we can use computer languages like C, C++, Java etc... to communicate with computer i.e. to give any work to computer to do.
ఈ లాంగ్వేజ్ ను ఉపయోగించి మనము కంప్యూటర్ తో చేయించవలసిన పనినే "ప్రోగ్రాం (Program)" అని అంటారు.
By using this language, The work which is given to computer to do is called "Program".
నిజ జీవతంలో మనము ఏదైనా పనిని చేఇంచడానికి ఒక పని వానిని నియమించి ఆ పనిని అతడు ఏ విదంగా చేయాలో అందుకు తగిన సూచనలను ఇస్తాము. అదే విధంగా C Language లో కుడా ఒక పనిని అనగా ప్రోగ్రాం ను చేఇంచడానికి వినియోగించే పనివాని లాంటి దానినే నే "ఫంక్షన్" (function) అనీ మరియు దానికి ఇచ్చే సూచనలనే "ఇన్స్ట్రక్షన్స్" లేదా "స్టేట్మెంట్స్" (instructions or statements) అనీ అంటాము. అనగా ప్రోగ్రాం అనగా పని అనీ మరియు ఫంక్షన్ అనగా ఆ పనిని చేసే ఒక పనివాని లాంటిది అనీ ఇన్స్ట్రక్షన్స్ అనగా అతనికి ఇచ్చే సూచనలని అర్థం.
In real life we hire a worker to do any work for us, then we give some instructions to him about that work. Same as in C-Language we use "Functions" (like workers) to do work (Program) and the instruction which are given to that function are called "Statements" or "Instructions". So "Program" means any "Work" and "Functions" means the "Workers" who are appointed to do the work and the "Statements" means the "Instructions" given to that functions.
ప్రతీ పనిని చేయడానికి కనీసం ఒక పనివాడైనా అవసరం.అదే కొంచం పెద్ద పనైతే ఎక్కువ మంది అవసరం.అదేవిధంగా ప్రతీ సి ప్రోగ్రాం లో మనము కనీసం ఒక ఫంక్షన్ ను ఉపయోగిస్తాము అదే "మెయిన్( )" ( main( ) ) అనే ఫంక్షన్. ఒకవేళ ఆ ప్రోగ్రాం పెద్దదిగా వుంటే ఒకటికన్నా ఎక్కువ ఫంక్షన్లను కూడా ఉపయోగిస్తాము.అలాంటి సందర్బం లో ఆ ప్రోగ్రాం మెయిన్ అనే ఫంక్షన్ తో మాత్రమే ప్రారంబించ బడుతుంది. సి లాంగ్వేజ్ లో ప్రతీ ఫంక్షన్ యొక్క పేరు ప్రక్కన ఒక ఓపెన్ మరియు క్లోజ్ బ్రాకెట్ లు అనగా "(" మరియు ")" లు తప్పని సరిగా వుంటాయి. మరియు అది చేయవలసిన పనికి సంబదించిన సూచనలన్నీ "{" మరియు "}" ల మధ్యన తెలియపరిచి వుంటాయి.ఈ ఓపెన్ బ్రాకెట్ నుండి క్లోజ్ బ్రాకెట్ వరకు తెలియపరచి వున్న సమాచారాన్నే, ఆ ఫంక్షన్ యొక్క "బ్లాక్" (block) అని అంటారు.
In real life we need at least one worker to do a small work, but in the case of a big work we need more workers to do that work. Same as in C-Language for a small program we use a singe function called
"main( )". In the case of a big program we can use so many functions as we need. In this case C-Language begins that work with "main( )" function only.
In C-Language we have to place the open and close brackets i.e. "(" & ")" after the function name and then we have to write all statements inside the open and close braces i.e. "{" & "}" below that function name.
సి ప్రోగ్రాం యొక్క నిర్మాణము (simple structure not complete) (పని i.e. Work)
ఫంక్షన్_యొక్క_పేరు1( ) ----------> పనివాడు
{ ----------> పని ప్రారంబం (block open)
ఒకటవ సూచన; ---------> చేయవలసిన పని ( Instruction or statement1 )
రెండవ సూచన;; ---------> చేయవలసిన పని
.......
}--------> పని అంతం (block close)
ఫంక్షన్_యొక్క_పేరు2( )
{
ఒకటవ సూచన;
రెండవ సూచన;
.......
}
..........
Ex:-
main( )
{
do this;
and this;
.....
}
addnums( )
{
--------;
--------;
..................
}
The simple structure of C-Program
function_name1( ) -------------> First and Main worker
{ -------------> Work begin
statement1; -------------> First instruction to do
statement2; -------------> Second instruction to do etc....
statement3;
.......
statement_n;
} -------------> Work end
function_name2( ) -------------> Second worker etc...
{
statement1;
statement2;
statement3;
.......
statement_n;
}
............
............
function_name_n( )
{
statement1;
statement2;
statement3;
.......
statement_n;
}
Ex:-
main( )
{
do this;
and this;
.....
}
addnums( )
{
--------;
--------;
..................
}
సారాంశం :-
1. సి ప్రోగ్రాం అనునది ఒకటి లేదా కొన్ని ఫంక్షన్ ల యొక్క సమూహం. ( 'C' program is a collection of functions)2. ప్రతీ సి ప్రోగ్రాం "మెయిన్" అనే ఫంక్షన్ తోనే ప్రారంబించ బడుతుంది. ( 'C' program always begins with main function)
3. ప్రతీ ఫంక్షన్ లో మనము తెలియ పరిచే సూచనలు ఖచ్చితంగా సెమికోలన్ అనగా ";" అనే గుర్తు తో ముగించవలెను. (Each statement of a function must be end with a semicolon symbol)
Summary :-
1. In C-Language the collection of functions is called a "Program".2. The c programs at least consists on function i.e. "main( )". and the program execution (mean doing work) always starts with "main( )" function only.
3. Each statement of a function must be end with a semicolon symbol.
సి భాష లోని అంశాలు
The Basic Elements To Learn C-Language
In real life to learn any language like English, First we learn Alphabets then Simple Words then Sentences Then Grammar etc...., Same as to learn C-Language we need to know about basic elements to write any "C-Programe" i.e. "C-Character set".
Now we will discuss about "C-Character set" in next post.
Thanks to you ..........
From : Pavan Kumar
No comments:
Post a Comment