How to exit program in C

1 Answer

0 votes
#include <stdio.h>
#include <stdlib.h>

int main(void) {
    char ch = 'z';
  	
  	if (ch == 'z') {
    	exit(0);    
    } else {
    	printf("Continue with the program");
    }
    
    return 0;
}



/*
run:


*/

 



answered Mar 25, 2021 by avibootz

Related questions

1 answer 182 views
1 answer 88 views
88 views asked Jun 24, 2025 by avibootz
1 answer 99 views
1 answer 94 views
94 views asked Jun 23, 2025 by avibootz
1 answer 91 views
91 views asked Jun 23, 2025 by avibootz
1 answer 97 views
1 answer 89 views
...