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

+1 vote
asked Aug 17, 2019 by anonymous
#include <stdio.h>
void increment1()
{
    auto int i=1;
    printf("increment 1():%d\n",i);
    i++;
}
main()
{
    int i;
    i;
}

7 Answers

0 votes
answered Aug 22, 2019 by bhoomi2000 (780 points)
write getch() in the end before curly brackets and write main function correctly
commented Aug 23, 2019 by Prabhat
you need to call the program from Main(). Until not called, function Increment1() will not work
0 votes
answered Aug 25, 2019 by anonymous
You need to call increment 1() method inside your main program
0 votes
answered Aug 28, 2019 by anonymous
There is no function call made of increment1() in main.
0 votes
answered Aug 28, 2019 by anonymous
u didn't call the function in the main method

#include <stdio.h>

void increment1()
{
    auto int i=1;
    printf("increment 1():%d\n",i);
    i++;
}
main()
{
    int i;
    increment1(5);
}
0 votes
answered Aug 28, 2019 by anonymous
use getch() it needs to close to run
0 votes
answered Aug 29, 2019 by Rapha
because don't have any printf;... it's better like this...

int main()
{
    int i, n;
    printf("I want increment ... Numember's\n");
    scanf("%d", &i);
    for(n=0; n < i; n++){
        printf("%d",n);
    }
    printf("%d", n);
    return 0;
    
}
0 votes
answered Aug 29, 2019 by Shekhar Baradkar (140 points)

#include <stdio.h>
void increment1(int i)
{
    auto int i=1;
    printf("increment 1():%d\n",i);
    i++;
}
main()
{
    int i;
   increment1(i);
}

you have t do this get ouptut as i=1 value

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.
...