Question: Consider the following small C program: #include void main() { somefunc(10); } void somefunc(int n) { //prints integers from n to 1. if (n >

Consider the following small C program:

#include

void main() {

somefunc(10);

}

void somefunc(int n) { //prints integers from n to 1.

if (n > 0) {

printf("%d", n);

somefunc(n - 1);

}

}

This program does not compile. What is the issue and how can it be fixed?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!