+ 1
Can anyone teach me that how to write a function?
4 Answers
+ 7
specify the data type of your function, give a space and write the name of your function with () attached to it. You will then add curly braces for the function body. Use void if the function has no return type. eg
If your function name is myFunc with integer data type then below is how you can declare it
int myFunc(){
//your code goes here
}
+ 1
Just take the course in this app. It teaches you how to write a general function.
0
Yeah what xyz said
0
1st u have to declare a function and then u have to write the function in a unique portion.. at last you have to call the function in your main function