Type of User-defined Functions in C
user-defined function เคे 4 เคตिเคญिเคจ्เคจ เคช्เคฐเคाเคฐ เคนो เคธเคเคคे เคนैं, เคตे เคนैं:
1. Function with no arguments and no return value
2. Function with no arguments and a return value
3. Function with arguments and no return value
4. Function with arguments and a return value
Below, we will discuss about all these types, along with program examples.
Function with no arguments and no return value
เคเคธे function เคा เคเคชเคฏोเค เคฏा เคคो เคाเคจเคाเคฐी เคช्เคฐเคฆเคฐ्เคถिเคค เคเคฐเคจे เคे เคฒिเค เคिเคฏा เคा เคธเคเคคा เคนै เคฏा เคตे เคชूเคฐी เคคเคฐเคน เคธे user เคเคจเคชुเค เคชเคฐ เคจिเคฐ्เคญเคฐ เคนोเคคे เคนैं।
เคจीเคे เคเค function เคा เคเค เคเคฆाเคนเคฐเคฃ เคนै, เคो user เคธे เคเคจเคชुเค เคे เคฐूเคช เคฎें 2 เคจंเคฌเคฐ เคฒेเคคा เคนै, เคเคฐ display เคเคฐเคคा เคนै เคो greater number เคนै।
Function with no arguments and a return value
เคนเคฎเคจे function เคो modified เคฌเคจाเคจे เคे เคฒिเค เคเคชเคฐोเค्เคค เคเคฆाเคนเคฐเคฃ เคो เคธंเคถोเคงिเคค เคिเคฏा เคนै greatNum() 2 เคเคจเคชुเค numbers เคฎें เคธे เคो number เค เคงिเค เคนै เคเคธे return เคเคฐें।
Function with arguments and no return value
เคนเคฎ เคเค เคนी function เคो เคเค เคเคฆाเคนเคฐเคฃ เคे เคฐूเคช เคฎें, เคฌाเคฐ-เคฌाเคฐ เคเคชเคฏोเค เคเคฐ เคฐเคนे เคนैं, เคฏเคน display เคเคฐเคจे เคे เคฒिเค เคि เคिเคธी เคธเคฎเคธ्เคฏा เคो เคนเคฒ เคเคฐเคจे เคे เคฒिเค เคเค เค เคฒเค-เค เคฒเค เคคเคฐीเคे เคนो เคธเคเคคे เคนैं।
เคเคธ เคฌाเคฐ, เคนเคฎเคจे function เคो modified เคฌเคจाเคจे เคे เคฒिเค เคเคชเคฐोเค्เคค เคเคฆाเคนเคฐเคฃ เคो เคธंเคถोเคงिเคค เคिเคฏा เคนै greatNum() เคฆो int values เคो เคคเคฐ्เค เคे เคฐूเคช เคฎें เคฒें, เคฒेเคिเคจ เคฏเคน เคुเค เคญी return เคจเคนीं เคเคฐेเคा।
Function with arguments and a return value
เคฏเคน เคธเคฌเคธे เค เค्เคा เคช्เคฐเคाเคฐ เคนै, เค्เคฏोंเคि เคฏเคน function เคो เคเคจเคชुเค เคเคฐ เคเคเคเคชुเค เคธे เคชूเคฐी เคคเคฐเคน เคธे เคธ्เคตเคคंเคค्เคฐ เคฌเคจाเคคा เคนै, เคเคฐ function body เคे เค ंเคฆเคฐ เคेเคตเคฒ เคคเคฐ्เค เคो define เคिเคฏा เคเคฏा เคนै।
Nesting of Functions
C language nesting of functions เคी เค เคจुเคฎเคคि เคฆेเคคी เคนै เคฏाเคจी เคिเคธी เค เคจ्เคฏ function body เคे เค ंเคฆเคฐ เคเค function เคा เคเคชเคฏोเค / เคॉเคฒ เคเคฐเคจे เคे เคฒिเค। เคจेเคธ्เคेเคก เคซ़ंเค्เคถंเคธ เคा เคเคชเคฏोเค เคเคฐเคคे เคธเคฎเคฏ เคนเคฎें เคธाเคตเคงाเคจ เคฐเคนเคจा เคाเคนिเค, เค्เคฏोंเคि เคเคธเคธे infinite nesting เคนो เคธเคเคคी เคนै।
เคฏเคฆि function2 () เคे เค ंเคฆเคฐ function1 () เคे เคฒिเค เคญी เคॉเคฒ เคนै, เคคो, เคเคธ เคธ्เคฅिเคคि เคฎें, เคฏเคน infinite nesting เคนोเคा। เคตे เคเค เคฆूเคธเคฐे เคो เคฌुเคฒाเคคे เคฐเคนेंเคे เคเคฐ เคाเคฐ्เคฏเค्เคฐเคฎ never terminate เคจเคนीं เคนोเคा।
0 Comments
Please don't Add spam links,
if you want backlinks from my blog contact me on rakeshmgs.in@gmail.com