What is the output ?


If the break is replaced by continue, what is the output ?


#include <stdio.h>

int main() {
        int i;

        for (i = 0 ;; i++) {
                i = i + 2;
                printf ("output : %d\n", i);
                break;
        }
        return 0;
}
             

Answer :

a) No output and program stops.
b) No output and programs runs indefinitely.



Comments

Popular posts from this blog

RUN JAVA PROJECT IN ANDROID STUDIO

Gradle DSL method not found: 'compile()'

Reverse string using recursion