Function Call by Name in C Programming Language
C Language
A function in C language is a block of code that performs a specific task. It has a name and it is reusable i.e. it can be executed from as many different parts in a C Program as required. It also optionally returns a value to the calling program
So function in a C program has some properties discussed below.
-
Every function has a unique name. This name is used to call function from “main()” function. A function can be called from within another function.
-
A function is independent and it can perform its task without intervention from or interfering with other parts of the program.
-
A function performs a specific task. A task is a distinct job that your program must perform as a part of its overall operation, such as adding two or more integer, sorting an array into numerical order, or calculating a cube root etc.
-
A function returns a value to the calling program. This is optional and depends upon the task your function is going to accomplish. Suppose you want to just show few lines through function then it is not necessary to return a value. But if you are calculating area of rectangle and wanted to use result somewhere in program then you have to send back (return) value to the calling function.
C language is collection of various library functions. If you have written a program in C then it is evident that you have used C’s inbuilt functions. Printf, scanf, clrscr etc. all are C’s inbuilt functions. You cannot imagine a C program without function.
Structure of a Function
A general form of a C function looks like this:
<return type> FunctionName (Argument1, Argument2, Argument3……)
{
Statement1;
Statement2;
Statement3;
}
An example of function.
int sum (int x, int y)
{
int result;
result = x + y;
return (result);
}
C language books on eBay
|
|
A Becka Grade 6 God's Gift of Language C Lot of 3 Books.
Current Bid: $4.99
|
|
|
The C Programming Language : ANSI C Version by DENNIS 2e
Current Bid: $26.85
|
|
|
Inside Language, Literacy, and Content Practice Book level C New
Current Bid: $9.99
|
|
|
Inside: Language, Literacy, and Content (Level C Writing) (Hardcover)
Current Bid: $9.99
|
|
|
C Programming Language (2nd Edition) (Prentice Hall Software)
Current Bid: $22.42
|
|
|
Inside: Language, Literacy, & Content - Level C vol 2 (Teacher's Edition)
Current Bid: $19.99
|
C language books on Amazon
Function Prototype and Function Definition in C Programming
Function prototype is very simple concept but the word (prototype) we use to call it makes it difficult to new C programmer to understand. In simple word, function prototype tells compiler that we are going to use a function which will have given name, return type and parameters. It’s that simple.
Function definition on the other hand is just writing logic of any function. For example you have one function prototype in C program for adding two integer numbers (i.e. int add(int, int)) but along with prototype you also have to write logic how that function will behave (respect to above prototype; how you will utilize those two passed integer value and how you will return value) when you will call that function.
Let’s take look at example for better and clear understanding:
Function Prototype and Function Definition Example
#include<stdio.h>
#include<conio.h>
void myFunction();
int add(int, int);
void main()
{
clrscr();
myFunction();
printf("\n\n%d",add(10,15));
getch();
}
void myFunction()
{
printf("This is inside function :D");
}
int add(int a, int b)
{
return a+b;
}
Explanation
Now we have a simple C program to demonstrate function prototype and function definition concept. We will start from line no. 4 & 5. In these two lines we have function prototype, line no. 4 has a simple function prototype which doesn’t have parameters or return type. It’s very simple to declare a prototype, see line no. 17 & 4, both line are same except prototype requires semicolon (;) at the end. Code block (line no. 17-20) is function definition for our first function prototype (i.e. line no. 4). In this block we are defining behavior of that function and in my code it’s just printing a simple message for demonstration.
Similarly we have second function prototype (line no. 5) and it has parameters and return type. Code block (line no. 22 – 25) is definition of above function prototype. One important point for function prototype having parameters; in prototype, variable name for parameters is optional (see line no. 5). There is no variable name for int parameters, its (int, int). But in that prototype’s function definition you must provide parameter variable name (see line no. 22). We have (int a, int b) parameter name.
One more important thing, if you writing function definition above main() function then you don’t need to write prototype of that function. But it’s a good practice to keep all the functions below main() function.
Advantages of using functions:
There are many advantages in using functions in a program they are:
- It makes possible top down modular programming. In this style of programming, the high level logic of the overall problem is solved first while the details of each lower level functions is addressed later.
- The length of the source program can be reduced by using functions at appropriate places.
- It becomes uncomplicated to locate and separate a faulty function for further study.
- A function may be used later by many other programs this means that a c programmer can use function written by others, instead of starting over from scratch.
- A function can be used to keep away from rewriting the same block of codes which we are going use two or more locations in a program. This is especially useful if the code involved is long or complicated.
Types of functions:
A function may belong to any one of the following categories:
- Functions with no arguments and no return values.
- Functions with arguments and no return values.
- Functions with arguments and return values.
- Functions that return multiple values.
- Functions with no arguments and return values.
Note : You can find details about different types of function in C language, click here read it now.
Example of function calling in C
#include<stdio.h>
#include<conio.h>
void add(int x,int y)
{
int result;
result = x+y;
printf("Sum of %d and %d is %d.\n\n",x,y,result);
}
void main()
{
clrscr();
add(10,15);
add(55,64);
add(168,325);
getch();
}
Program Output
Explanation
Before I explain, let me give you an overview of above c program code. This is a very simple program which has only function named “add()” . Calling this C function from “main()” is very simple. This “add()” function takes two values as arguments, adds those two values and prints the result.
Line 3-8 is a function block of the program. Line no. 3 is the header of function, void is return type of function, add is function name and (int x, int y) are variable which can hold integer values to x and y respectively. When we call function, line no. “12, 13, 14”, we need to send two integer values as its argument. Then these two values get stored in variable x and y of line no. 3. Now we have two values to perform addition; in line no. 5 there is an integer declaration named “result”. This integer will store the sum of x and y (please see line no. 6). Line no. 7 simply prints the result with C’s inbuilt function “printf”.
Now imagine the same program without using function. We have called “add()” function three times, to get the same output without using function we have to write Line no. 6 & 7 three time. If you want to add more value later in the program then again you have to type those two lines. Above example is a small and simple program so it does not appear great to use function. But assume a function consist 20 – 30 or more lines then it would not be wise to write same block of code wherever we need them. In such cases functions come handy, declare once, use wherever you want.
Function examples
- How to Reverse a Number?
This tutorial will help you to learn about function with parameters and return type. This tutorial is about how to reverse a number where I created a new function to reverse a number. Hope this will help to understand function better... - Call by Value and Call by Reference in C Programming
Call by value and call by reference is the most confusing concept among new C language programmer. I also struggled with this, the reason may be my teacher is not explaining it in simple words or I was dumb. Whatever the reason is; here I will try to
Share your opinion with me
Did this tutorial helped you to learn function in C language?
See results without votingC programming tutorial
- C Programming Lesson - Call by Value and Call by Reference
Call by value and call by reference is the most confusing concept among new C language programmer. I also struggled with this, the reason may be my teacher is not explaining it in simple words or I was dumb. Whatever the reason is; here I will try to - C Programming Lesson - Brief History
Before we start any complex program in C, we must understand what really C is, how it came into existence and how it differs from other languages of that time. In this tutorial I will try to talk about these... - C Programming Lesson - Basic Virtual Keyboard Application
To accomplish this task you dont need to buy any expensive software or hardware, only a little knowledge of C program will do and you can build your own musical keyboard software. Before we begin you... - C Programming Lesson - Header File and Main Function
Every C complier provides a library of around 200 or more predefined functions and macros which we can use in our C program. These library functions or inbuilt functions help programmers to perform common programming task rapidly and efficiently. The - C Programming Lesson - Do While Loop and Difference Between While and Do While Loop
If you are looking for what is loop and why we use loop in c language then you can check my article on that topic. This article is entirely dedicated to do-while loop and its usage. I must tell you that do-while loop is similar to while loop but only - C Programming Lesson - While loop
I already explained what is loop and why we use loop in c language, and I am not going to repeat that here again. So we will start with while loop explanation. While loop is one of the simple loop available in C language.It’s very easy to use, lets - C Programming Lesson - For loop and how for loop works
Along with while loop and do-while loop, for loop is also part of C programming language. For many programmers, for loop seems to be easiest loop comparing other two loops (while and do-while loop). Mainly its structure (syntactically) makes it easy - C Programming Lesson - Looping in C Programming, Types of Loop and Loop Example
Loop is one of the important parts of C language and study of C language is incomplete without this. So let’s head towards completion of our knowledge about C language. As a dedicated C language leaner, right now you should have two questions. What i - C Programming Lesson - Types of Function
In my previous c programming tutorial I tried to explain what the function, its advantages is and how to declare a C function. And I told you that there are five types of functions and they are: - Swap two variables without using third variable in C , C# and Java
This article explains how we can swap variable values without using third variable. There are different ways to do so and I tried including all know methods. You can get code in C, Java and C# language. - C Programming Lesson - Array in C programming
An array in C language is a collection of similar data-type, means an array can hold value of a particular data type for which it has been declared. Arrays can be created from any of the C data-types int, float, and char..... - C Programming Lesson - Pointers
In this tutorial I am going to discuss what pointer is and how to use them in our C program. Many C programming learner thinks that pointer is one of the difficult topic in C language but it’s not completely true. It is difficult to understand....... - C Programming Lesson - Recursion in C language
We have learnt different types function C language and now I am going to explain recursive function in C. A function is called “recursive” if a statement within body of that function calls the same function for example look at below code:.... - C Programming Lesson - File Copy Program in C
Today we are going to learn a simple file copy program in C language. As I said this is a simple file copy program so you should not expect its output like DOS copy command has. Ok lets start. The main...
This Hub was last updated on June 18, 2012
Follow (3)Comments 287 comments
quite difficult 4r beginners........
i never understand about functions clearly . After reading ur topic i understand very well. Thanks a lot.
Tell me one thing Mr. Raj how function internally operate?
I wanna ask about the existence and working of formal arguements?
SIR can you teach me/us about function with scanf? i suggest about programming a factorial or fibonacci... i just dont really get it how to call the function from main... specially the design...:((
hello, dost its very easy way to understand
thanx!
plz send that how to program excute.
I hav to giv a seminar on functions in my college,will u plz suggest me d points that I include n how to answer d queries asked by students? plz answer ma immediately.
what is coding of adding two number in function using
How can i used multi function in one program???
Hai sir/mam:
Thanx for the detail explanation of functions.
sir thanks a lot for clrearly description of funtion .now i know very well about function.please desc it in c# . i shall very greatful to you.
great to see c language in well defined parts.thank you sooooooooooooooooooooo muchhhhhhhhhhhhhhhhhhhhhhhhhhh
Thanks. I'll be stopping by to read these chapters day by day. Great info for beginner programmers !
thankyou providing information
This site is very useful to study about C language.
If you provide us various types of programs then thanks to you.
how would i create a function that would print a several numbers inputted with spaces.
sample
input nunber:123456
output:
1 2 3 4 5 6
how you can help me.
thanks!
why function return only one value
what is the diffrence between functions and procedures?
need help!
how would you create a function that finds and add the even and odd numbers present in an input.
example:
input:123456
output:
odd: 1,3,5
sum:9
even: 2,4,6
sum: 12
hope you can help me. tnx!
I love c language because of my dear sir Akmal shah
I read in cecos university
alaka pa c banday ba zaan poya key kani o ba mo wajnama
i read in svnpg college of tarkwari. our teacher is Mr. ravi kant chadda.
THIS FUNCTION R VERRY CLEARLY INDSTANDEBAL
very nice
thanks for the valuable information
very nice comments
THX ALOT I UNDRSTND DIS LANGUAGE ESLY WAY
Thanks
May be i get 30 out of 30 in my mid exam after i read your more explanation.
10q
yemane
from MIT,Ethiopia
plz teach me eveything in c through mail....................
gud haney
best way for study
ya best result in studying
function is the life in c languge
thanks i am well satisfied
this is jeevan.before read this page i am not perfect c concepts.present understand and i solve some problems.please give more examples.thanking you
sir can u tell me about working of scanf and printf function that how both functions take multiple arguments........plzzzzzz
very helpful for learning fuction/
little bit clear................
gr8 2 learn
gr8 become the fan of this site
i am a fan of this site
HI I URGENTLY NEED A HELP. I HAVE TO GIVE A SEMINAR ON FUNCTIONS OF C FOR AN HOUR. I WANT ENOUGH INFO ON IT IN SIMPLE LANGUAGE i.e IN LAYMAN LANGUAGE. SO THAT I CAN EXPLAIN IT VERY CLEARLY AND ALSO ABLE TO CLEAR THE DOUBTS ARAISED. I HAVE LESS TIME. IT WILL BE HELPFUL IF I GET IT ASAP
I want to know what is function
I don't understand!!
Its very useful for the begineers.
Thnks a lot for this article.
what example u gave above nice this is well useful those want learn c progarm
it's nice...............
i cant understand...now itself i am confusing
Only good.....
this tutorial is great!! thanks!! Good Job
It is useful for me
good day! how to encrypt-decrypt numbers...its goes like this..users are asked to enter 4 digit no. e.g 1,2,3,4 and again will ask them an encryption key lets say 7. the encrypted no. will be 8,9,0,1..how to code this using a function?? pls help. thank you.
how to insert integer values into a rectangle using c graphics
Excellent! now i need not worry about c languge.
sir, your tutorial is our confidence ,your explanation goal is on pin-pointed notes,
Thanks lot of,
ITS VERY USEFUL OR ME,THNX FOR THIS TUTORIAL
how to insert values of x and y by user....
Excellent write up. Useful for my exams...thanks.
need some more information.......more examples too.....otherwise its good thanks...
How functions defined that is exact to programme.And how to remember there is any commands?
Dear friend,
It is good.I never understood what is function before. but now i understood clearly.
=========================All the Best============================
wats the 2 types of function C
sir..plz tell me what is the accual defination of libary function?
jpio;i
thanx for such a clear my doubt..............
i like dis very much........thanx a lot.........sir...
I am hanuman saran from bikaner
are you great teacher thanks for answer of main function
simple and best
hai am raghuramsingh am studying c language i have more doubt in c . what is output why to see the output what the benifit for that
Nice one. . . was understandable clearly thanks!!!!!
THANX FOR YOUR BRILLIANT MIND... I GOT IT.
it is very great t
ok!!!!!!!!!
i loved reading it
it is very bad
c subject is a very pakav subject
I LOVE C LANGUAGE AND MY TEACHER AMIT DUTTA AND I NAYAN SHILL.I AM A STUDENT OF TEZPUR UNIVERSITY.
in this site explanation of c language is good
You done a great job.Its very easy to understand.After reading your explanation i got some knowledge about c language.
why function is need in any programming language?
gooddddddddddddddddddddddddddddddddddd
Hi friend my Q: without the "void main" c program making?
can u give an example with RETURN();
can u give more information about return type programs.i want more explations ls sir
i want some more material on c language.with easy to understand sir.u r article was good.iam waiting for u r reply sir
Hi Raj !
Nice job, well elaborated with very easy to understand examples, I would appreciate if you can cover advance level of Data Structure.
MSC. IT Student, Nepal
sir really its very helpul for me to learn c in beter way gr8
simple and easy to understand...........thanx:-)
Very Good Explination
I indeed appreciate the academic interaction.Please,how best can i explain or make presentation on the topic fuction with vivid examples to a lay person begining a C lanuage class?
Hi..., This Tarun Frm Bhopal
i have some doubt in C program as per ur Exaple..."Example of a simple function to add two integers "
#include
#include
void add(int x,int y)
{
int result;
result = x+y;
printf("Sum of %d and %d is %d.\n\n",x,y,result);
}
void main()
{
clrscr();
add(10,15);
add(55,64);
add(168,325);
getch();
}
this is my write programme but my result is
*some Statement Missing* SO,......
tell me about why this error in my programme..
& i want to remove this Error ..!!!!
Tell me the Good Sujestion .............!!!!
Rpl. ASAP :-)
i want to know about pointers
dear sir,
thank for this function detail for learner. a lot of thank on this topic.
its crap
Give me more information about functions with good examples to easy understanding.
good explanation for why we are using functions...,
Hello Tarun
Your code is working
#include
#include
void add(int x,int y)
{
int result;
result = x+y;
printf("Sum of %d and %d is %d.\n\n",x,y,result);
}
void main()
{
clrscr();
add(10,15);
add(55,64);
add(168,325);
getch();
}
RUN:
Sum of 10 and 15 is 25.
Sum of 55 and 64 is 119.
Sum of 168 and 325 is 493.
nice detail i understand it wel.it solve my problm
Thanks
thank you for explaining of functions clearly , but I want more problems
I want more information about functions.
sir je please give me ans what is c++ and c and visual basic
Thanks for the above function example,i find it very useful
is there ncessary declaration of functions in c? if we dont declare the functions tnen it will give error message?
Very nice website it is
aoa sir piz send examples of functions and difference between calling function and declare function
it is simply
and its example is very superb.
THANKU
SIR ,IN examples of functions that u have stated ,there is no function declaration part. why ? i have read that function declaration is necessary otherwise there will be error . pls explain.
It is difficult to understand if we don't know c language...
WHY WE WRITE main() in a C PROGRAM ? WHAT IS THE IMPORTANCE OF MAIN() IN C LANGUAGE ?
sir, why () is used in writing a function?
give me deatils of mathematical and string functions in c
sir thankx for information............ but iam a beginner especially i dont three concepts in c program (i.e)structures, pointers and function....... so,kindly help me if u have any notes or program for easy understanding plz send it to my email "writetome.shiva@gmail.com".............
3d array initialization kaise hota hai
thank u ..it was useful to me
the details are very clear to understand.thanx for helping.
really Good and knowledgeable keep good going....
You can Take Help to me In C Programming...
I am a Student of MCA
dddddd
very nice brother.........
nice example
Very clear explaination with perfect sequence...great !!!
thanx
hello sir...
why are use the function and pointer in c Language?
A FUNCTION IS A PROGRAMMING UNIT WHICH CAN BE IDENTIFIED BY A UNIQUE NAME.
ONCE DEFINED, IT CAN BE CALLED BY A PROGRAM
easier way to undertand c, my logics are not clear.
Hai understood clearly What is the function.explanation is good..i want more pblms related to the function
Sir: all this is clear but I want to know where fuctions are applied.I think they are applied in mobile where the main function is sub divided into modules like phone book,settings etc. if htsi argument is correct please send me some examples programs with functions. THANK YOU.
i want to know about c function one by one
Great Job,
i was confused to learn about these Functions in C.
but now little bit Cleared for me to understand it.
Thanks Sir.
God bless you.
sir , please tell me what is main difference in call by value and call by refernce with suitable example.
What are the called and calling function.plz explain with example.
sir , please tell me what is main difference in call by value and call by refernce with suitable example
sir...
wat r arguments nd return value??????
prototypes r classified in 3 types based on arguments nd returnvalues..................
so,, plz kindly explain abt them with good examples
plz sir.........
great, thank you for your pages !!!
as main() functions calls other functions, who does call to main()function ?
too bad i dont like software.
software engineer will be no job n next 1 year
sir plz explain about standard functions
jina marji parrh lo job ta koi milnai nahi hegi
sir tell ma about array use in function
It's a good explanation about Functions in c language , but i've small doubt in recursive i.e,when function calls it self , how will it returns the value and multiply with the previous value ? i*fact(i-1); now is the value of fact(i-1) is 4 ? pls explain me clearly.
c program is i con't undrstsnd plz help me
before seeing this site i felt functions very difficult but after reading from here i understood about functions clearly THANK YOU SO MUCH.
thnx alot.
it's very useful for me...Thanks a lot...
it's very useful for me...Thanks a lot...
i am chandra kr shill from tezpur assam and 2 no dolabari tezpur university
i am nayan shill from Tezpur Assam,
address-> 2-no dolabari Tinmile Tezpur assam.
i am reading in Tezpur University ,,doeacc,,Computer scince ,,
mobile no--9707184966
my class name is --,O,Levle 2 semester 2011 year
thx to clear the concept of function
i need the program for this question plz
write a program to read two numbers and swap the values and print it out using functions
hi @geetha : you need to know "call by value" and "call by reference" concept to do this program. hope u know that.
i wanna learn c language plese teach me
Thnx 4 ,,,better definition of FUNCTION
THNX4 FUNCTION DATILS
I LIKE THIS SITE............
sir i want to be master of c from which can i downloal software
sir
lote of thanks for telling and descraption of function
sir. gud day..can you give the code of the program that calculates the discount of customer considering the amount paid for an item. if amount paid is less than 500, it displays thank you. the total payment is xxx.xx. otherwise, display the discount and compute for the net amount a customer has to pay. 20% is given to a customer who purchase more than 500, computation of discount should be located on a certain function which will be called inside the loop.
thank you sir..
i'll be glad and thankful for your immediate response for this..
Thank u sir.after reading ur topics in function i really much more satisfied from before. now i m happy.
its very helpful for me thanks
I am most powerfull student.
but c is my diffecult subject.so how do you advice me in oreder to make c my easiest subject.
with great kindely
k good not bad
Its easy to Understand ur topic .i am satisfie ur topip thanks
very very useful..
after reading this i understood what is a function n its functionalities..
thx... sir
this article helped me a lot.... but could you please show the same program without using functions......
thanks man for ur invaluable support..............:)
sir i am confused in the topics of functioncalling i.e.,call by reference, call by value can u explain me in detail?
Sir,
what is the difference between calling function and called function,where we have to write these two .
Sir please post the answer as quickly as possible. And guide us what are the important concepts we have to go through in functions while revising it.
c subject is the very simple
it was absolutely ossso ... all ths days i was nt able to give the technical definition of function
thank u for the gr8 informations
Thanks a lot sir........but can i have more info about pointers and arrays...I am a fresher nd i need info urgently.....
nice bhaiyya..!!!
i understood very well the need of function....i am satisfied with your explaination ...thanq sir
its fine.....
i can't understanding about function please provide some examples and some theory
i understood very well the need of function....i am satisfied with your explaination ...thanq sir
i m weak in c. so how can i improve my c
change your example
I am read soo much time about function but I don't uderstood
plz help me
summary about function I want to you
plz send me the ans to kalyani.siva.siva@gmail.com
I think you help me
good explanation:)
it is very useful...
thanku..
here we can must say that without function when we can doing progarm then it is very lengthy, function is veri useful fof increae execution speed of progarm,
it is also useful for built a system software during 2 sem i had taken good experience. so,function is one type of block statement which is user want that what will be want.
------>Mansuri Nurulhuda from chikhli(casps college).
if you will have any problem in programming then just sent your question on to my id ....
SEHWAG.MANNA@YAHOO.COM
if we understand it is easy to solve functions
Please create a program that would exhibit the 4 types of functions.
is it any person capable who not know much
nice example
tnx..
hello brother is this enough to study c language?
a good example
Hello Sir,
I have a tc through which i execute all my c & c++ pgm.
I want to run Window base pgm through my tc compiler but it has not window.h header file.
How can i add that header file into my tc.
Please sir reply me.
pls how solve the infix to prefix & prefix evaluation
hi,
i need a program for a calculation as follows
1*8+1=9
12*8+2=98
.
.
.
123456789*8+9=987654321
what's the logic please help me
thanx alot!!!
thanx for this help
it is more efficient for knowledge
fantastic
in my exam, syllabus for coputer paper is functions of c, but my pages are lost of thus lesson and i was finding this lesson, so, i got it in internt, i am very happy today
i want to know full discription abaut functions in c
how to develop the program swap the no without using variable?
i want to know both Advantages and Disadvantages of C functions
good for reading it
thnks
c
nice it solve my problem
sir can you please give some more examples of functions that will make it more understandable???
the programm was gud and its a nice procedure
pls explain c progrmming ??
This is so clear and easy to understand.Thanks a lot.
Can we pass "result" as interger as argument inside the add function, without passing separately?
eg;
void (int x, int y, int result)
Thanx for providing guideeness
hi sir
i really understand from this description. so thnx dear
dear sir!
i m so much happy for your nice procedure in c.thanks ......
i'm realy thankful to u.
thanks.....
will u please post the program explaining using function inside a function.......which explains clearly....pls do favour....
thank u sir i am very happy to get such help by ur programs
thanks
what is the program of multiplication in function
5
5 5
5 5 5
plz send me d 'c' code for the above problem
sir plz give me details fuction in c for collage seminar
sir please explain deeply about function prototype and finction defination
what are the type conversions ?explain with the help of an example?
thanx dude u are a great teacher. my whole problems are solved now in function.
thnks for info
thank you
thnx man...saved my ass before my semester.! :)
good job man....
It is a good progrram using function.
thanx, it's good using function.
My problems in c function are solved now
how to pass the characters using function..(without using pointers)
bundle of thanks ,i have learnt much of functions
hiiiiiiiiiiiiiiii!!!!!it's really good,but I am a student of 8 grade,so i want extra explanation,will you help by online chat.AS i am intrested in this topic......so when you are online,please tell me
hiiiiii sir,you are awesome but can you give me a program to find the factorial of a number,please post it fast.................
Hi,some doubts..
why do u write getch() in void main()?
How do u realize whether your function should return a value?
Thanks..
hi,
its very useful...
thanks alot.
hi, mr.raj
am asking: 1. what is prototype?
can explain other way plz.
2. call by value,call by reference ?
please explain the program, how the execution will done:
int main()
{
int c=printf("hello");
return 0;
exit(10);
}
sir plz will u explaun the program of recurrsion plz sir i cnt get tht program
plz sir explain need of user defined function
sir plz explaun the nots:- 1)introduction to programming 2)Algorithms for problem solving 3)introduction to 'c'lang 4)condition statements and loops 5)arrays 6)function 7)strctures and unions 8)structures and unions 9)pointers 10)self Refential structures and linked lists 11) file processing...plz plz sir i wat my e-mail id :- sunilnirmalkar@gmail.com
Types of functions:
A function may belong to any one of the following categories:
Functions with no arguments and no return values.
Functions with arguments and no return values.
Functions with arguments and return values.
Functions that return multiple values.
Functions with no arguments and return values.plz explain it
itzzzz amazing raj..i dint really knew anything abt functions.the way u arrange things with numbering of each line and their link to other line is simply incredible.if i become a gr8 s/w engg,i wud surely say u were the man behind me..i wud be pumped if i cud meet u..,i live in hosur which is quite near to urs..giv ur mob.no to this pls..praveenvenugopal24@yahoo.com...plzzzzzzz...
m asking 1 que.....
what is different betbeen call by reference and call by result value
we can know more new things in c-programs
no comment
SOMEWHAT CLEAR
code for the print the longest word written in a line using udf...plzz reply fast...
it is very useful thanx to give us brief knowledge
its very helpful for me thanks
thanks sir it was amazing.
thanks dude
hi!sir could you please give me an idea to make this program!!
1. Write a program that determines whether a positive integer is a prime number. A prime number is a number that can only be evenly divided by 1 and itself. The program should contain the function,isPrime, and returns 1 if the integer is a prime number and return 0 if otherwise.
differentiate between call by value and call by referance while calling a function
very good who have posted this
Thank you this is really very helpful for me. Thanks again.
can you help me to solve this program
Print following pattern using a C program.take the string as input from the user .write a genric program to acceptt string of any length...
Example pattern
If the user input nepal than the output should be as follow
1N
2EE
3PPP
4AAAA
5LLLLL
i want to print a rectangle using functions and for loop in c...any help please
its so nice
a program that will take total marks of 3 frndz koli,joli, moli
grading scheme: more than 89=A+,80 to 89=A,70 to 79=B+,
60 to 69=B,50 to 59 =C,less than 50=F.
kathy got the higest .
sample input:75,95,85
sample out put:joli got the higest number.
I love c language thanks to chetan vyas sir. mai kuch mahine pahale c me kuch bhi nahi janta tha aur aaj mai program ache se kar leta hu jiska pura shrey chetan sir ko jata hai jisne itni mehanat ke sath mujhe padaya aur mujhe guide kiya thanks sir.
can you help me to do this?
i cant get the output, but there's no mistakes in my coding.
'write a program that ask the user to enter a temperature reading in centigrade and then prints the equivalent Fahrenheit value. It then ask the user to enter a Fahrenheit value and prints out the equivalent centigrade value. Run the program several times. Be sure to include at least one negative temperature reading in your test cases. Provide separate functions as needed by your design.Your main function should have only function calls. The input, Fahrenheit=100, Celsius=36.9 '
Hope you can help me.. thank you!
it's very easy and helpful solution of function . i like it
it's easy example for explain. sorry ,but i am weak in c.
i hope you can helped me.
please give me 'c' notes.
thank you.
that's call function definition.Very good function describe and give the examples.
good explanation
its verry-verry helpful for me.....
sir i ask
Dear sir,want to know about data abstraction in c++.sir I cannot understand it .I think that data abstraction also occur in c language also sir please helpme and please tell me your book of c++ link
Can help me do this?
Write a complete user friendly menu driven C program to perform Matrix operations such as Addition, Subtraction, Multiplication and Transpose according to the user’s choice.
Thanks
thank you so much...
Dear Raj, many thanks for a clear exposition of each theme.
I didn't see an example for something similar to what I am trying to code.
I am using a Pic 18F2550 and the C18 c0mpiler.
The program itself is very simple in structure.
************************************
NTC thermistor -- 18F2550 -- LCD 44780
************************************
Yes a thermometer.
You explained some very important things to me. I program quite well in Pic Assembler but you helped me see.
1. What in C is named as a function, It is named as a subroutine in assembler
2. The assembler program usually has a MAIN which basically "call" a set of subroutines.
You showed me the Call word is not need in C, naming the subroutine is sufficient
3. Just one little problem .
In the above thermometer example, before you can send data to the LCD, you need to Initiate with a series of set up commands.
This is a ONE TIME block of code.
Then after that the following functions are
executed.
sequence then is
0. Initiate
1. Read NTC resistance do 10bit voltage to Resistance conversion..
2.Do maths to convert the resistance to temperature
3. Send temperature to the LCD
4. Go back to 1. for the next temperature reading.
I'm thinking this is a loop , an infinite while(1) loop only broken by an out of range voltage.
Then print resistance error.
I'll keep on reading your C seminar to see if you think something like this could be of general interest.
My best wishes
Fred
Madrid, Spain
yar main ny jitny b functions waly programs try kiye hain koi b nai chala hi... sir your program is also dont working so give me some more examples. with full syntex. thanx
what is the differece between formal and actual arguments?
0
thanks, it help me to understand function . but give more example for better understanding
What is the difference between calling a function by value and by reference?






Multi dimensional array (3D Array) in C Programming...
Types of Function in C Programming Language
Recursive function in C programming language
About C Programming; An Overview
The C Programming Language: Data and Variables
Learning the Go Programming Language, First Steps
vtu ada lab programs 1
Most popular and Useful Java Books for Beginners and Non-programmers
Java Programming with Eclipse-The Best Beginners Tutorial:Overloading And...
Introduction to Object Oriented Programming Concepts

rajkishor09 4 years ago from Bangalore, Karnataka, INDIA Hub Author
Feel free to ask questions, post suggestion, discuss this with me or other.