2 using c language please explain Which line has an error vo

2. using c language, please explain

Which line has an error? void firstFunction(int var) {printf(\"You are inside of firstFunction.\ \"); return var + 1;} int main() {int number printf(\"Enter the number\ ); scanf(\"%\", &number;); firstFunction(number); return 0;} firstFunction(number): return var+ 1; No answer text provided. scanf(\"%i\", &number;);

Solution

Answer: No answer text provided.

there is an issue in printf statement double quote was missing.

printf(\"Enter the number\ \"); it will cause compilation error.

Along with this issue, there is another issue in return statement. it will give a warning while compiling the code.

firstFunction(number) funtion is a void type. it means it will not return any value but inside function we defined like return a value by using this statement return var + 1 which is incorrect here.

2. using c language, please explain Which line has an error? void firstFunction(int var) {printf(\

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site