55 - CATEGORIES OF FUNCTION DEFINITIONS - C PROGRAMMING
ฝัง
- เผยแพร่เมื่อ 26 ส.ค. 2024
- There are four categories of Function Definitions
1) Function Definition with Arguments and With Return Value
2) Function Definition with Arguments and Without Return Value
3) Function Definition without Arguments and With Return Value
4) Function Definition without Arguments and Without Return Value
I watch this channel only , whenever I have doubt in c programming because Sundeep sir explains very well
super, i read most of the comments and full video thanks for your service to country
good and excellent explanation bro
i have watched many videos in C functions but i didn't get clear in that
In this video,I got some clear ideas in functions.Such a good explanation bro.
keep it up.
best for people who want learn in detail,
sir is one of the best i have seen
sir in the functions with arguments and without return type , in the function definition we should write void add(int x,int y) ..........
Yes we can bro
Yes you are right
Yes,I was also thinking that,
But where is the function declaration in all programs sir...u have to mention
Sir your explanation is nice. In second and fourth example,in the function definition,the return type of add function should be void instead of int.Function prototype/declaration may be included
It was very nice and neat explanation sir... Thank you sir👌:-)
thanks for your interest towards our channel.
Now understanding functions very well. Value return topic explanation is really superb...thanks allot sir
You are unique sir .. explaining with an example 😃
love u sir,great job,keep it up....
So well u have explained sir it's really easy to understand I learnt so much from this video sir superb👍👍
thank u sir..... This video was a great help for me....
Tq sir for this video after 3years it is better than ppt presentation
Clear and comprehensible, sir
In 2nd and 4th type why u have written int add(.....) even if they r not returning any value....? Plz reply
Nailed it sir..
But I have a doubt
If not returning any value
Then why need to use int
in the place can we use void
Plz clarify
Yaaa without doubt we can use
In function defination,In without return value case ,you wrote int add(),instead of void add()..A small mistake
excellent explanation sir.....
Sir
Please continue sir
Your lessons are very useful to me and so many students like me sir
Thank you sir
very intersting course .i owe u much
hi diarra
thank you for your interest towards our channel and do subscribe to our channel for more videos.
As like the cases in 2 and 4 should we write void in function declaration
Excellent teaching
Great explanation
Superb sir... Mind blowing we can easily able to understand.. Thank u
Super sir I understand very much sir
U r really helpfull to lot of students sir🙏
At 10:46 in the second column in the function definition you assign sum with the value 0. Why ? Can't you just create the variable sum without giving it a value?
Your explanation is really good . Thank you soo much
hi divya
thanks for your interest towards our channel and share my sessions with your friends and subscribe to our channel.Keep following our channel.
sir u r explanation is very good
Sir as in without argument and without return value example, you by mistakenly used int return type in function definition there must me void.(void add()), and even in with argument and without return type too you wrote int in return type in func def instead of void
Sir... compared with previous functions basic vedios we should use res=a+b in definition part
But in this vedios in examples why we used that res=x+y instead a+b
Is both are correct
In previous video he did wrong that he used res=a+b but the correct thing is res=x+y.Because we declare intX and int Y in the function definition.
explained clearly.thank you sir.
Really awesome explanation sir.....
you cleared my doubt
hi sir.
I'm having a doubt.....just function call and function definition is enough to run a program know.....what is the use of declaring a function?
please clarify my doubt sir.
hi
if you write function definition above the main function then we need not write the function declaration.
if you write function definition below the main function then it is mandatory to declare a function.
what ever the case function call should be written in main function.
Hope your doubt has been clarified.
Fabulous explanation sir👌
very very thanks sir for clearing my concept
hi thanks for showing interest towards our channel and share my sessions with your friends
If Called function is inside another function then what will be the sequence of execution?
Thank you sir for this vedio
Sir,,thanks a lot ,,I had a lot of doubts regrding functions,really appreciable and you are trying your best to understand concepts easier,thanks alot 🙏🏻🙏🏻,sir I have a doubt,when we return values to the main function we should assign that value to other variable right?suppose we are not assigning that value to another variable ,and just giving printf the value of ‘res’,then it will show error?
In the example of adding (a+ b) in this programming practice, which one would you suggest using? I know its based on the situation but if you pick the 4th option, would it run the programme quicker or easier for debugging? Thank you so much, I love your channel.
Very clear explanation.Thankyou sir
Superb explanation sir....thank u...
super perfect explanation.Fred ,Kenya
Excellent teaching sir
Nycc sir..
Hi Sir
why we are assigning (sum=0) in the local declaration part and why not simply (sum). Please clarify this doubt sir
Nice explination sir... I have one doubt:
What is the use of arguements again when we are declaring the variables in the function definition...
Sirr we are not returning any value means then we should use data type void right ?in case of 2 and 4 you have written int data type why so ? what is the reason?
Sir , in 2 and 4 cases you written int add so can it be ok or should write void add instead of that sir. Your videoes are quite interesting and helped me very much in 1 sem at corana academic holidays .hope you will give the answer sir...
Tq soo much all ur videos sr really helped a lot
Outstanding explanation sir
is there any practical usage of these different finction definitions?
I got the concept but what is the difference among using these function when output is gonna be same?
Good Thanks
Sandeep thank you sir for your explanations about functions..you cleared my doubt about different types of functions
hi hashi
thanks for your interest towards our channel and share my sessions with
your friends and subscribe to our channel.Keep following our channel.
❤️❤️❤️❤️
Very wonderful sir ☺
Best explanation but you are not mention prototype sir
sir in 2nd and 4th condition the function dec , return type should be void ri8?
Ss
you are awesome... Sir...
Thanks sir... what's the best practice of writing of all 4..and different uses
Sir in the previous video .. There is function declaration .. The same program u write in this video in four types.. But u didn't write function declaration. Why?
Sir, I too have a question..
Is that optional to use ' void ' as the return_type when the function does not return any value { sir, you have used ' int ' as the return_type in the above program ( in the 2nd and 4th type of function) is that too correct ?}
hi
yes we can use void if the main function doesn't return any value.
but, u have used int why is that ?
hi
i have used int there beacuse have to return the result to the main function. You can use void function rather than int if it doesnt return any value.
Thank you for your awesome videos. I have the same question here. If the 2nd and 4th type of function "does not return the result to the main function" , why don't we use "void add" rather than "int add" ?
Thank sir , interesting
hi mahesh
thanks for following my sessions.
I am from Bangladesh,your teaching system very well.
Which is better possibility of using either return or void
hi pranav
that should be used based on the requirement of the problem
thanks for your interest towards our channel and share my sessions with your friends and subscribe to our channel.Keep following our channel.
Super sir clear explanation
thank you for watching and supporting our channel.
Sir if we are using void main is that necessary to put sum =0 because in some prgm we are not using it
hii sir.. is it possible to change the values given to varibles in without arguments type function... or they are fixed values only??
In this 4 types which type is generally used sir
Perfect explanation sir
Sir when we use int data type
And when to use void data type
Hi
If the called function definition return any integer value to calling function then we have to write int.
If the called function definition doesn't return any value to the calling function then we have to write void.
Hope your doubt has been clarified.
Sir,
Please explain how to write programs by using functions and how can we write big programs by using functions
Super explanation sir
Sir in case of with arguments and without return type we should write void am I right?
super sir
where is the function declaration during the metioning of examples of type of function??
hi rahul
we have to declare the function but due to space problem i have ignored the function definition.
Sir, can u tell, why we use different variable names for actual and formal parameters from function call to function definition?
hi rahul
that is not mandatory and you can use the same variable names for both actual and formal parameters that doesnt matters. As they are local variable both will have their on memory space.
Sir why didn't use void in no return function...
Nice video sir
sir i think we should use void instead of int for (without return value example)
thanks samuel nice observation.
sir why we need to declare a new varible=0 like res=0 or sum=0
Hi
Variables declared but not initialized will be having garbage values so if you don't initialized the output variables to 0 then garbage values may affect the result.
Sir u dint write function declaration is that ok?
Sir can u explain the difference between int main and void main ??
sir i have dought, why function was not declared above the main( ) on these programs
hi anujith
if the function definition was written above the main function then no need of declaring the function and if the function definition is written after the main function then we have to declare the functions.
@@sundeepsaradhi but sir in these programs function definition is written after the main function so it needs to be declared before main()
@@rajesha4958 yeah he wasn't declared due to space...but have to declared the function if function definition written after main function
I am a beginner shall I watch this videos and become a coder sir
Sir why you are using int sum=0
Sir, if we are using scanf function in function definition part of the function without return, how can it would be without arguement and without return function?
HI satish
here arguments are the parameters passing to function and return is the value which is returned to main function. that doesn't depends on scanf function.
sir please explain c++ also !! thank you :) and sir can you please explain about scope and macros and recursion too
hi keerthi
once the completion of information security i will upload the next subject.
Here sir...i have a qstn sir...
Should not we need to declare the function before the int main??
hi sankhadip
if the user defined function is written above main function then we need not declare the function and if the user defined function has been written after the main function then we have to declare the function at above the main function.
Hope your doubt has been clarified.
Sundeep Saradhi got it,sir.thank u
Sundeep Saradhi Kanthety but sir u hv not declared the function before the main function in the video
Sir u give perfect explanation but can you also provide some notes so that we can easily learn and memorise for further time
thank you so much Guruji😊😊
hello sir...
why you are assigning zero for sum , we can simply give sum ?????
can you give explaination why we should give sum=0
hi chandra shekar
if we declare any variable and not initialized any value to it , by deefault that variable will be having some garbage value so if we try to use that variable in expression we may get result computed with garbage value. so we have initialized the variable sum with 0.
it would be better to initialize the output variables with 0.
Hope your doubt has been clarified.
@@sundeepsaradhi tq sir
interesting sir!
hi
thanks for watching my sessions. subscribe to our channel and keep following my sessions.
Sir I have doubt about main and void main difference.is it possible to write as void main as main and main as void main
actually void is a return type. here our main function doesnt return any value so we can use void before main. If main function returns an integer value then we need to write int main(). so you can write any of one either main or void main. Depends on the logic we need to select main or void main.
sir,y should we write result=0,but not only result
hi sathwik
for the output variables we need to initialize with zero because we are not initializing the output variables and only the result will be assigned to output variables. By default output variables will have GARBAGE VALUES which may give incorrect results.
Fix your camera /video quality its quite blurry
Sir why didn't u written
int sum=0;
Sum=add( );
In with out arguments,without return value s pleace explain sir
Sum=add(); can only be written only when you return some value to the variable Sum but without arguments.
And add() has not assigned any variable ( unlike Sum in above case ) so no need to return any values.
Thank you sir.
thanks ,
there wont be any int in 4 as its without arguements and return it shoul be add()
hi rahman
i didnt get you plz make it clear so that it will be easy for me to clarify it.