Why we need function in c programming! | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Why we need function in c programming!

using functions we return value. then we print whether its true or not!

7th Jan 2017, 2:08 PM
Rindi Hasan
Rindi Hasan - avatar
2 Answers
+ 5
printf is one of function if you dont want any function so what will result be?
7th Jan 2017, 2:19 PM
Yanothai Chaitawat
Yanothai Chaitawat - avatar
+ 1
functions are for to run the same functionality multiple times. somebody have to write it once, than them or others can use it in other places in the code. a good example for this is the is_prime(int num) function which returns true if its parameter is a prime number. you can write this function and use it in multiple places or even miltiple programs too.
7th Jan 2017, 2:41 PM
DFX
DFX - avatar