#15 C Functions | C Programming for Beginners
Вставка
- Опубліковано 21 лип 2024
- #15 C Functions | C Programming for Beginners
In this video, we will learn about functions to divide our program into small blocks of codes. We will try out examples using Function Parameters. And we will discuss return types and Function Prototype. We will also learn different types of Standard Library Functions available in C programming.
This video is a part of our C Programming video series: • #1: Getting Started wi...
~
Resources:
C Online Compiler: www.programiz.com/c-programmi...
Github File: github.com/programiz/c-youtub...
C Functions Tutorial (text-based tutorial): www.programiz.com/c-programmi...
Timestamps:
00:00 Start
00:18 C Functions
01:06 Syntax of Function
04:55 Function Parameters
05:23 Create a function with parameter
09:42 Return Type
12:44 Function Prototype
14:18 Standard Library Function
16:12 main Function
16:33 programming task
17:01 Quiz
~
Revise your learning using our C App
Download here for Android: bit.ly/3upaInx
Download here for iOS: apple.co/3EZLtNq
Find Programiz elsewhere:
Facebook: / programiz
Instagram: / _programiz
LinkedIn: / programiz
Website: www.programiz.com
Twitter: / programiz
#programiz #cfunctions #cprogramming #learnc #functions #cfunction #returntype #learncprogramming #functionsinc
🔥Finding it Damn Hard to Understand C Programming?
Learn to code-the right way-with interactive lessons, quizzes & challenges. Build a strong programming base; it's IMPORTANT!
Try Programiz PRO for Free: bit.ly/master-c-programming
Please I need your help !!!!
#include
#include
int function(int a, int b)
{
int i=a;
if (i
I completed my 12th one month ago and learning C language for the first time and these series were really very very helpful. thanks a lot🤗
#include
int multiplyNumbers(int number1, int number2){
int product = number1*number2;
return product;
}
int main(){
int result= multiplyNumbers(7,8);
printf("result=%d", result);
return 0;
}
now, that's what you call teaching. my prof can't even make me understand this sub T^T. but you did it in just a few minutes. thank you very much.
Glad we could help!
@@programizstudios thanks to you, I think I ace ng exam today 😉
I agree very well explained!!
As a person who just started learning Software Engineering I have found these videos most helpful indeed. Definitely subscribing and recommending this channel to any other people I may come across who are in the process of learning software engineering. Great job !!!
Very good very dope. Spent 3 week eeking by in class not knowing the semantics of calling a function. Solved weeks long headache in less than 20 minutes. Appreciate it a million times over!
this was very easy to understand with walk throughs of clear examples. I know more now than I did 13min ago, thank you for your time.
very elegant person you are, accompanied with good skill of teaching. looking forward to see more of your work. Thank you
These videos are very helpful! 17 minutes for a tutorial is very professional
One of the best lectures for this topic on the internet
These tutorials have been the best for simple explanations and work great to code along too and practice, THANK YOU!
for the problem i think its answer is C
#include
#include
int multNumbers(int number1, int number2);
int main() {
int number1;
int number2;
printf("Enter Number 1:
");
scanf("%d",&number1);
printf("Enter Number 2:
");
scanf("%d",&number2);
int sum = multNumbers(number1,number2);//dont call this too early remember its proceedural
printf("The result of %d * %d = %d",number1, number2, sum);
return 0;
}
int multNumbers(int number1, int number2){
int product = number1 * number2;
return product;
}
I get this buy why did we initialize number1 and number2 in both the function and main
@@bwon8233 to my understanding you're creating space to hold the values you're going to be taking from the user. And in the function we're not initializing, we are doing a method call to the function miltNumbers. That reference is being passed as the arguments number1 and number2.
This is the best video explaining functions in C that I could find from both searches in English and Spanish, great job guys, thank you!
😍
Watched all the 15 videos. Really appreciatable work... Mam u r teaching very well.. waiting with expectation for upcoming tutorials.. pls make videos for remaining Syntax .. thank u❤️
Best way to teaching I love all the videos of this channel ❤️
Padma mam you are so cool
i am in first year CS student your teaching is superb
Thorough explanation and so clear to grasp quickly. Thank you for these valuable contents through this valuable channel. I am grateful.
So helpful tutorials and your website as well.
Your way of teaching is really good.
Finally I understood what passing a value in function means my gosh it took me so many videos 😂 on UA-cam
wow! you make C so interesting for me😥. Thanks!💗 i recommend this for anyone!
for the last question A and C is correct but difference the first just call and second calling and store value inside integer which will cast the result from double to integer
Amazing teaching skills……. Helps alot to understand functions……✨✨✨
Please do more videos. I really like this simple way of explanations and demonstrations.
I’ve watched hours of videos and tNice tutorials one is the first that explains it in a way a complete beginner could understand! Great videoccccccccc
// can you create a function, takes two floating numbers, performs the multiplication of two numbers, returns the result using function prototype?
#include
float multiplyNumbers(float num1,float num2);
int main(){
float result= multiplyNumbers(5.2,2.5);
printf("Result is %.2f",result);
return 0;
}
float multiplyNumbers(float num1,float num2){
float product = num1 * num2;
return product;
}
Best way to teaching I love all the videos of this channel ❤
Your understanding is excellent🙂🙂
it's so well explained thank for this gift may God Bless you
I already thought I would never understand it. Thanks!
Very helpful tutorials, Thanks.
16:33 programming task
#include
int Addnumber(){
int number, number2;
printf("Enter a first values: ");
scanf("%d",&number);
printf("Enter a second values: ");
scanf("%d",&number2);
int sum = number + number2;
return sum;
}
int main()
{
int result =Addnumber();
printf("Result = %d", result);
return 0;
}
wrong bro , programming task multiply by taking two numbers
it should be int sum = number * number2;
you just render every thing in programming easier
Thank you....this video explained functions very simply...and her accent is cute XD
you are an amazing teacher thank you very much
very well defined and constructive video
Thank you so much mam B. TECH-IT
First year mam very helpful mam
Mam you are very skillfull in coding 🥰🥰help us and upload more videos plzz
Thanks madam for your services
so good vid, better than my lecturer
Thank you, this was so helpful
Making understanding easy, thanks
Very helpful. Thanks
thank you programiz team..!!
Wounder full teaching mam
I like this, Thank You😊🙌
The answer for that question is "c" i.e int result=test(8.3,2);
Can I always use void as return type in functions??
thank you programiz team
is the quiz answer option c?
Hey, where is the answer of this programming quiz, it is not written on github
Thanks for your best lessons
it's amazing mam👍
thanks for the great support
I hope ou can keep it up
Thank you very much!!
Great video 🎉
Thanks it helped me install it
Thank you so much
So easy to understand...
You are the best ❤️
Thanks a lot
does function prototype is compulsory? Some code that I run I don't have function prototype and it still work even the user-defined function made below not above the main function? So does it really need?
Nope. Function prototype is not mandatory. If you are defining the function first and calling the function, its not necessary. If you are calling and then defining the function, Then the Function Prototype is required. :)
good work king, love you
Thank you 😊
THANK YOU SO SO MUUUUUCH
thank you mam.
Happy programming.!
thank u
Nice video💙
Thanks ma'am
nice..please tell me someone whats the answer of the quiz.Thanks
Nice 👍
I did not get when I use prototype and when I use the other thing
Thanks
Answer for Proggramming Task Today:
#include
int multification(int num1, int num2);
int main(){
int n1, n2;
printf("Enter number 1:");
scanf("%d",&n1);
printf("Enter number 2:");
scanf("%d",&n2);
int res = multification(n1, n2);
printf("Result = %d",res);
return 0;
}
int multification(int num1, int num2){
int multi = num1 * num2;
return multi;
}
#include
void addNumbers(double number1, double number2){
double sum = number1 + number2;
printf("%lf + %lf = %.2lf", number1, number2, sum);
}
int main(){
addNumbers(5.2, 3.55);
}
for 9:38
thanks
this best course
by the void method and the return method: (without the printf and scanf parts)
/*//Chap 15.3 Function Prog.Task//
void multiNum(int num151, int num152){
int prod15 = num151 * num152;
printf("The Product of %d and %d is %d
", num151, num152, prod15);
}
int main() {
multiNum(2,6);*/
//Return//
int multiNum2(int num1512, int num1522){
int prod152 = num1512 * num1522;
return prod152;
}
int main() {
int result153 = multiNum2(6,7);
printf("Result 2 = %d", result153);
I've been using you're website for a month lol
the best!!
Thank you so much for this video!!! Very helpful!
You are so welcome!
A is the correct answer.
good content
//Can you create a function that
// • takes two numbers
// • performs the multiplication of two numbers
// • returns the result
double multi(double num1, double num2) {
return num1 * num2;
}
// Aswer is C
#include
int productnumbers(int number1, int number2);
int main(){
int result = productnumbers(4,5);
printf("result is %d", result);
return 0;
}
int productnumbers(int number1, int number2){
int product = number1 * number2;
return product;
printf("after return");
}
programing quiz Awnser.
result is 20
what a beautiful and smart woman.This lesson was so helpful thank you.
The answer of the quiz is A
nice
🤩 "Voice"
Guys, can anyone explain me the exact need of return statement please? I'm still searching for a good explanation. hope you'll help me out....
same
Options A and C, according to the next video C #16 respectively at 16:00 and 14:25.
Thanks C compiler.😅
Can we use C function to use a switch
If you can use an if-else chain in that function there is no reason for you not to use switch.
ty
#include
int multiply( int number1, int number2){
int product= number1 * number2;
return product;
}
int main() {
int result= multiply (5,6);
printf ("The product is %d", result);
return 0;
}
#include
int calc(a,b){
int mult=a*b;
return mult;}
int main(a,b){
printf("write a and b:");
scanf("%d %d",&a,&b);
int mult=calc(a,b);
printf("the multiplication is %d",mult);
return 0;
} i wrote it im so proud of me
C. int result = test(8.3, 2);
#include
#include
int operation(int num1,int num2)
{
int multiply =num1*num2;
return multiply;
}
int main(){
int result=operation(5,6);
printf("result = %d",result);
return 0;
}
Good❤
Big fan Padma😭😭❤️
B.(8.3,2) Is the answer to quiz
Ma'am A ya C m confusion hai
option c is right to call a function
programing task:
#include
#include
int product(int number1,int number2);
int main()
{
int result=product(5,5);
return 0;
}
int product(int number1,int number2)
{
int product=number1*number2;
printf("produt=%d",product);
return product;
}
why option C? i thought the option A is right....