Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

Result of this Program in C

–2 votes
asked Mar 29, 2019 by Vamsi
int main()
{
    int i;

for (i=0;i<=10;++i)
        display(--i);  

return 0;
}
void display(int );
void display(int m) {
    printf("%d",m);
    }

2 Answers

0 votes
answered Mar 30, 2019 by anonymous
it will give compiler error

you should write function definition before main program so it can identify there is such a function in program
0 votes
answered Oct 15, 2019 by saiteja (290 points)

The answer for the program entered is -1,-1,-1.......upto infinite. Because the initial value of 'i' taken in for loop is 0 and you are displaying --i.

So, the answer will be -1,nothing will print for m.

#include<stdio.h>
void display(int m);
int main()
{
    int i;
    for(i=0;i<10;++i)
    {
        display(--i);
    }

    return 0;
}    
    
    void display(int m)
    { 
        printf("%d",m);
        
    }
    

Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...