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

ความคิดเห็น • 165

  • @TharunKumar-yx8cy
    @TharunKumar-yx8cy 3 ปีที่แล้ว +5

    I watch this channel only , whenever I have doubt in c programming because Sundeep sir explains very well

  • @starxeroxnehrunagar8551
    @starxeroxnehrunagar8551 4 ปีที่แล้ว +5

    super, i read most of the comments and full video thanks for your service to country

  • @insanedevelopment8270
    @insanedevelopment8270 5 ปีที่แล้ว +7

    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.

  • @kousikgadivemula3165
    @kousikgadivemula3165 3 ปีที่แล้ว +1

    best for people who want learn in detail,
    sir is one of the best i have seen

  • @rakeshnaidu7115
    @rakeshnaidu7115 5 ปีที่แล้ว +30

    sir in the functions with arguments and without return type , in the function definition we should write void add(int x,int y) ..........

  • @ShashikK-sr3hw
    @ShashikK-sr3hw 4 ปีที่แล้ว +4

    But where is the function declaration in all programs sir...u have to mention

  • @sivakamasundarig.7499
    @sivakamasundarig.7499 4 ปีที่แล้ว +3

    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

  • @saidarshan4938
    @saidarshan4938 6 ปีที่แล้ว +7

    It was very nice and neat explanation sir... Thank you sir👌:-)

    • @sundeepsaradhi
      @sundeepsaradhi  6 ปีที่แล้ว +2

      thanks for your interest towards our channel.

  • @cjoy2037
    @cjoy2037 4 ปีที่แล้ว

    Now understanding functions very well. Value return topic explanation is really superb...thanks allot sir

  • @saikrishnatalla7848
    @saikrishnatalla7848 3 ปีที่แล้ว +1

    You are unique sir .. explaining with an example 😃

  • @lmt2612
    @lmt2612 3 ปีที่แล้ว +1

    love u sir,great job,keep it up....

  • @lekhanayaka1830
    @lekhanayaka1830 3 ปีที่แล้ว

    So well u have explained sir it's really easy to understand I learnt so much from this video sir superb👍👍

  • @shreerambharadwaj2623
    @shreerambharadwaj2623 5 ปีที่แล้ว +1

    thank u sir..... This video was a great help for me....

  • @maripijayanth1705
    @maripijayanth1705 3 ปีที่แล้ว

    Tq sir for this video after 3years it is better than ppt presentation

  • @poojar7764
    @poojar7764 3 ปีที่แล้ว +1

    Clear and comprehensible, sir

  • @rittikbanerjee8665
    @rittikbanerjee8665 5 ปีที่แล้ว +3

    In 2nd and 4th type why u have written int add(.....) even if they r not returning any value....? Plz reply

  • @decibi2684
    @decibi2684 5 ปีที่แล้ว +10

    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

    • @suryapadala54
      @suryapadala54 4 ปีที่แล้ว

      Yaaa without doubt we can use

  • @singireddyrakesh4831
    @singireddyrakesh4831 3 ปีที่แล้ว +1

    In function defination,In without return value case ,you wrote int add(),instead of void add()..A small mistake

  • @iruthiksankar5537
    @iruthiksankar5537 3 ปีที่แล้ว

    excellent explanation sir.....

  • @krishnareddykrishnareddy3076
    @krishnareddykrishnareddy3076 5 ปีที่แล้ว

    Sir
    Please continue sir
    Your lessons are very useful to me and so many students like me sir
    Thank you sir

  • @dramanediarra4574
    @dramanediarra4574 6 ปีที่แล้ว +2

    very intersting course .i owe u much

    • @sundeepsaradhi
      @sundeepsaradhi  6 ปีที่แล้ว

      hi diarra
      thank you for your interest towards our channel and do subscribe to our channel for more videos.

  • @RAKESHKUMAR-fc5lx
    @RAKESHKUMAR-fc5lx 4 ปีที่แล้ว +1

    As like the cases in 2 and 4 should we write void in function declaration

  • @whiteff5394
    @whiteff5394 ปีที่แล้ว

    Excellent teaching

  • @mask_man8924
    @mask_man8924 ปีที่แล้ว

    Great explanation

  • @saisureshsanapala6292
    @saisureshsanapala6292 5 ปีที่แล้ว

    Superb sir... Mind blowing we can easily able to understand.. Thank u

  • @vallimanickam7439
    @vallimanickam7439 3 ปีที่แล้ว

    Super sir I understand very much sir

  • @madhulatha2989
    @madhulatha2989 3 ปีที่แล้ว

    U r really helpfull to lot of students sir🙏

  • @benjaminterrell2221
    @benjaminterrell2221 2 ปีที่แล้ว

    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?

  • @divyabs8022
    @divyabs8022 6 ปีที่แล้ว +1

    Your explanation is really good . Thank you soo much

    • @sundeepsaradhi
      @sundeepsaradhi  6 ปีที่แล้ว +1

      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.

  • @saidivyag653
    @saidivyag653 5 ปีที่แล้ว

    sir u r explanation is very good

  • @satyasailokeshseela3640
    @satyasailokeshseela3640 2 ปีที่แล้ว

    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

  • @yuvarajveeramallu6124
    @yuvarajveeramallu6124 5 ปีที่แล้ว +3

    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

    • @badruddindulvi4819
      @badruddindulvi4819 5 ปีที่แล้ว +1

      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.

  • @mahendrareddy1709
    @mahendrareddy1709 4 ปีที่แล้ว +1

    explained clearly.thank you sir.

  • @rittikroy1342
    @rittikroy1342 5 ปีที่แล้ว

    Really awesome explanation sir.....
    you cleared my doubt

  • @ramyaj3637
    @ramyaj3637 4 ปีที่แล้ว +2

    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.

    • @sundeepsaradhi
      @sundeepsaradhi  4 ปีที่แล้ว +2

      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.

  • @growthinstinct3190
    @growthinstinct3190 3 ปีที่แล้ว

    Fabulous explanation sir👌

  • @Endless4Entertainment
    @Endless4Entertainment 6 ปีที่แล้ว +1

    very very thanks sir for clearing my concept

    • @sundeepsaradhi
      @sundeepsaradhi  6 ปีที่แล้ว +1

      hi thanks for showing interest towards our channel and share my sessions with your friends

  • @dialogue-scenes-songs-shor930
    @dialogue-scenes-songs-shor930 3 ปีที่แล้ว

    If Called function is inside another function then what will be the sequence of execution?

  • @anishali01
    @anishali01 5 ปีที่แล้ว +1

    Thank you sir for this vedio

  • @kavyajayesh7665
    @kavyajayesh7665 2 ปีที่แล้ว

    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?

  • @ssaridagli
    @ssaridagli 5 ปีที่แล้ว +1

    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.

  • @lllllllll7325
    @lllllllll7325 6 ปีที่แล้ว

    Very clear explanation.Thankyou sir

  • @bangaruvenkey2941
    @bangaruvenkey2941 5 ปีที่แล้ว

    Superb explanation sir....thank u...

  • @fredrickbandi7740
    @fredrickbandi7740 5 ปีที่แล้ว

    super perfect explanation.Fred ,Kenya

  • @adapasowmya7023
    @adapasowmya7023 5 ปีที่แล้ว

    Excellent teaching sir

  • @Fittodothings
    @Fittodothings 4 ปีที่แล้ว

    Nycc sir..

  • @ashokarthanari136
    @ashokarthanari136 4 ปีที่แล้ว

    Hi Sir
    why we are assigning (sum=0) in the local declaration part and why not simply (sum). Please clarify this doubt sir

  • @ashish-fi8by
    @ashish-fi8by 3 ปีที่แล้ว

    Nice explination sir... I have one doubt:
    What is the use of arguements again when we are declaring the variables in the function definition...

  • @maheshpatil7236
    @maheshpatil7236 3 ปีที่แล้ว

    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?

  • @musriefsantosh1872
    @musriefsantosh1872 3 ปีที่แล้ว

    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...

  • @poojashettyrs6132
    @poojashettyrs6132 5 ปีที่แล้ว

    Tq soo much all ur videos sr really helped a lot

  • @ramteja1657
    @ramteja1657 5 ปีที่แล้ว

    Outstanding explanation sir

  • @thurairajahsutharsan5935
    @thurairajahsutharsan5935 2 ปีที่แล้ว

    is there any practical usage of these different finction definitions?

  • @rubysayyedpanwaar1899
    @rubysayyedpanwaar1899 5 ปีที่แล้ว

    I got the concept but what is the difference among using these function when output is gonna be same?

  • @TechProgrammingIdeas
    @TechProgrammingIdeas 4 ปีที่แล้ว

    Good Thanks

  • @hashibarre1014
    @hashibarre1014 6 ปีที่แล้ว +1

    Sandeep thank you sir for your explanations about functions..you cleared my doubt about different types of functions

    • @sundeepsaradhi
      @sundeepsaradhi  6 ปีที่แล้ว

      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.

  • @darshanshetty-fs5to
    @darshanshetty-fs5to ปีที่แล้ว +1

    ❤️❤️❤️❤️

  • @priyadharsiniboopathi4986
    @priyadharsiniboopathi4986 4 ปีที่แล้ว

    Very wonderful sir ☺

  • @pandu7248
    @pandu7248 2 ปีที่แล้ว

    Best explanation but you are not mention prototype sir

  • @tanishksahjra1498
    @tanishksahjra1498 5 ปีที่แล้ว +4

    sir in 2nd and 4th condition the function dec , return type should be void ri8?

  • @khanimrankhan
    @khanimrankhan 5 ปีที่แล้ว

    you are awesome... Sir...

  • @JagadisM
    @JagadisM 4 ปีที่แล้ว

    Thanks sir... what's the best practice of writing of all 4..and different uses

  • @harinidumpa4570
    @harinidumpa4570 3 ปีที่แล้ว

    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?

  • @random-respectx
    @random-respectx 6 ปีที่แล้ว +3

    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 ?}

    • @sundeepsaradhi
      @sundeepsaradhi  6 ปีที่แล้ว

      hi
      yes we can use void if the main function doesn't return any value.

    • @random-respectx
      @random-respectx 6 ปีที่แล้ว +1

      but, u have used int why is that ?

    • @sundeepsaradhi
      @sundeepsaradhi  6 ปีที่แล้ว

      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.

    • @ssaridagli
      @ssaridagli 5 ปีที่แล้ว

      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" ?

  • @maheshbhatm9998
    @maheshbhatm9998 6 ปีที่แล้ว +2

    Thank sir , interesting

    • @sundeepsaradhi
      @sundeepsaradhi  6 ปีที่แล้ว

      hi mahesh
      thanks for following my sessions.

  • @md.mehedihasan3843
    @md.mehedihasan3843 5 ปีที่แล้ว

    I am from Bangladesh,your teaching system very well.

  • @pranavsai8633
    @pranavsai8633 6 ปีที่แล้ว +1

    Which is better possibility of using either return or void

    • @sundeepsaradhi
      @sundeepsaradhi  6 ปีที่แล้ว

      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.

  • @sirishasangu5626
    @sirishasangu5626 6 ปีที่แล้ว +1

    Super sir clear explanation

    • @sundeepsaradhi
      @sundeepsaradhi  6 ปีที่แล้ว

      thank you for watching and supporting our channel.

  • @gourikumar4574
    @gourikumar4574 4 ปีที่แล้ว

    Sir if we are using void main is that necessary to put sum =0 because in some prgm we are not using it

  • @pulivarthisairam6404
    @pulivarthisairam6404 4 ปีที่แล้ว

    hii sir.. is it possible to change the values given to varibles in without arguments type function... or they are fixed values only??

  • @nithins4155
    @nithins4155 4 ปีที่แล้ว

    In this 4 types which type is generally used sir

  • @PAVA1GKWORLD
    @PAVA1GKWORLD 5 ปีที่แล้ว

    Perfect explanation sir

  • @adityabardhangupta9839
    @adityabardhangupta9839 4 ปีที่แล้ว +2

    Sir when we use int data type
    And when to use void data type

    • @sundeepsaradhi
      @sundeepsaradhi  4 ปีที่แล้ว +10

      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.

  • @anilkumarvoonna4956
    @anilkumarvoonna4956 4 ปีที่แล้ว

    Sir,
    Please explain how to write programs by using functions and how can we write big programs by using functions

  • @sridharb8134
    @sridharb8134 5 ปีที่แล้ว

    Super explanation sir

  • @aklakhahmad1725
    @aklakhahmad1725 3 ปีที่แล้ว

    Sir in case of with arguments and without return type we should write void am I right?

  • @shivaprasadchary14
    @shivaprasadchary14 3 ปีที่แล้ว

    super sir

  • @rhul0017
    @rhul0017 6 ปีที่แล้ว +2

    where is the function declaration during the metioning of examples of type of function??

    • @sundeepsaradhi
      @sundeepsaradhi  6 ปีที่แล้ว +1

      hi rahul
      we have to declare the function but due to space problem i have ignored the function definition.

    • @rhul0017
      @rhul0017 6 ปีที่แล้ว +1

      Sir, can u tell, why we use different variable names for actual and formal parameters from function call to function definition?

    • @sundeepsaradhi
      @sundeepsaradhi  6 ปีที่แล้ว +2

      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.

  • @venuvinnu6807
    @venuvinnu6807 5 ปีที่แล้ว

    Sir why didn't use void in no return function...

  • @yanamalasugunakarreddy6052
    @yanamalasugunakarreddy6052 5 ปีที่แล้ว

    Nice video sir

  • @samueltamirat8696
    @samueltamirat8696 6 ปีที่แล้ว +1

    sir i think we should use void instead of int for (without return value example)

  • @Reeves_77
    @Reeves_77 4 ปีที่แล้ว +1

    sir why we need to declare a new varible=0 like res=0 or sum=0

    • @sundeepsaradhi
      @sundeepsaradhi  4 ปีที่แล้ว

      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.

  • @mrdcool
    @mrdcool 4 ปีที่แล้ว

    Sir u dint write function declaration is that ok?

  • @marripudianil9140
    @marripudianil9140 2 ปีที่แล้ว

    Sir can u explain the difference between int main and void main ??

  • @anujithmd5284
    @anujithmd5284 6 ปีที่แล้ว +2

    sir i have dought, why function was not declared above the main( ) on these programs

    • @sundeepsaradhi
      @sundeepsaradhi  6 ปีที่แล้ว +3

      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.

    • @rajesha4958
      @rajesha4958 3 ปีที่แล้ว

      @@sundeepsaradhi but sir in these programs function definition is written after the main function so it needs to be declared before main()

    • @vishnuprakash470
      @vishnuprakash470 3 ปีที่แล้ว

      @@rajesha4958 yeah he wasn't declared due to space...but have to declared the function if function definition written after main function

  • @aravindhanraghuls268
    @aravindhanraghuls268 6 ปีที่แล้ว

    I am a beginner shall I watch this videos and become a coder sir

  • @varunmalali4880
    @varunmalali4880 3 ปีที่แล้ว

    Sir why you are using int sum=0

  • @satishkumar-jy4bi
    @satishkumar-jy4bi 6 ปีที่แล้ว +1

    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?

    • @sundeepsaradhi
      @sundeepsaradhi  6 ปีที่แล้ว

      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.

  • @keerthi6940
    @keerthi6940 6 ปีที่แล้ว +2

    sir please explain c++ also !! thank you :) and sir can you please explain about scope and macros and recursion too

    • @sundeepsaradhi
      @sundeepsaradhi  6 ปีที่แล้ว

      hi keerthi
      once the completion of information security i will upload the next subject.

  • @sankhadipsamanta7708
    @sankhadipsamanta7708 6 ปีที่แล้ว +3

    Here sir...i have a qstn sir...
    Should not we need to declare the function before the int main??

    • @sundeepsaradhi
      @sundeepsaradhi  6 ปีที่แล้ว +5

      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.

    • @sankhadipsamanta7708
      @sankhadipsamanta7708 6 ปีที่แล้ว +1

      Sundeep Saradhi got it,sir.thank u

    • @manojkumar1439
      @manojkumar1439 6 ปีที่แล้ว +1

      Sundeep Saradhi Kanthety but sir u hv not declared the function before the main function in the video

    • @govindasindhu3728
      @govindasindhu3728 5 ปีที่แล้ว

      Sir u give perfect explanation but can you also provide some notes so that we can easily learn and memorise for further time

  • @VBeniwal_IITKGP
    @VBeniwal_IITKGP 5 ปีที่แล้ว

    thank you so much Guruji😊😊

  • @chandrasekharreddy2698
    @chandrasekharreddy2698 6 ปีที่แล้ว +1

    hello sir...
    why you are assigning zero for sum , we can simply give sum ?????
    can you give explaination why we should give sum=0

    • @sundeepsaradhi
      @sundeepsaradhi  6 ปีที่แล้ว +2

      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.

    • @munny5257
      @munny5257 5 ปีที่แล้ว

      @@sundeepsaradhi tq sir

  • @tekleabgebremedhin2668
    @tekleabgebremedhin2668 6 ปีที่แล้ว +1

    interesting sir!

    • @sundeepsaradhi
      @sundeepsaradhi  6 ปีที่แล้ว

      hi
      thanks for watching my sessions. subscribe to our channel and keep following my sessions.

  • @sirishasangu5626
    @sirishasangu5626 6 ปีที่แล้ว +1

    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

    • @sundeepsaradhi
      @sundeepsaradhi  6 ปีที่แล้ว

      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.

  • @solveunsolvable1024
    @solveunsolvable1024 6 ปีที่แล้ว +1

    sir,y should we write result=0,but not only result

    • @sundeepsaradhi
      @sundeepsaradhi  6 ปีที่แล้ว +1

      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.

  • @Scientific_Lifestyle
    @Scientific_Lifestyle 5 ปีที่แล้ว

    Fix your camera /video quality its quite blurry

  • @karumurishiva2046
    @karumurishiva2046 4 ปีที่แล้ว

    Sir why didn't u written
    int sum=0;
    Sum=add( );
    In with out arguments,without return value s pleace explain sir

    • @satyaprakashmohanty1017
      @satyaprakashmohanty1017 4 ปีที่แล้ว +1

      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.

  • @sandeepkumarmamidala3006
    @sandeepkumarmamidala3006 5 ปีที่แล้ว

    Thank you sir.

  • @preetinder2954
    @preetinder2954 5 ปีที่แล้ว

    thanks ,

  • @ashikurpavel8923
    @ashikurpavel8923 6 ปีที่แล้ว +1

    there wont be any int in 4 as its without arguements and return it shoul be add()

    • @sundeepsaradhi
      @sundeepsaradhi  6 ปีที่แล้ว

      hi rahman
      i didnt get you plz make it clear so that it will be easy for me to clarify it.