Function example in C

#include<stdio.h> // Function with no parameter no return value void amiDourai() { printf("ami somoy paile dourabo.\n"); } // Function with parameter but no return value void amiDourai2(int a) { printf("ami somoy paile %d minute dourabo.\n",a*a); } // Function with parameter but return value int amiDourai3(int a,int b) { printf("ami somoy paile sokale %d minute & bikele %d minute dourabo.\n",a,b); return a+b; } // Function with no parameter but return value float pi() { float K = 3.1416; return K; } int main() { int C,a,b; //function call = functionName(arguments); amiDourai(); amiDourai2(10); scanf("%d %d",&a,&b); C = amiDourai3(a,b); printf("Ami total %d min dourai.\n",C); printf("Pi er value hocce: %f\n",pi()); return 0; }

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.