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.

why it wont show anyoutput for the below program

0 votes
asked Aug 17, 2019 by anonymous
#include <stdio.h>
#include<stdbool.h>
void increment2()
{
    static  int 2=1;
    printf("increment 2():%d\n",i);
    i++;
}
main()
{
    int i;
    i;
}

4 Answers

0 votes
answered Aug 20, 2019 by anonymous

Because there is no declaration of main function and, before closing main function. we must also include getch() function in the end of program 

0 votes
answered Aug 20, 2019 by SWengineer
You failed to call increment2() inside main()
0 votes
answered Aug 22, 2019 by anonymous
Failed to call increment2() function in main and name of static int var can't be "2".
0 votes
answered Aug 22, 2019 by bhoomi2000 (780 points)
write getch() in the end before curly brackets
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.
...