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 273 views
1 answer 180 views
180 views asked Jun 24, 2025 by avibootz
1 answer 175 views
1 answer 181 views
181 views asked Jun 23, 2025 by avibootz
1 answer 164 views
164 views asked Jun 23, 2025 by avibootz
1 answer 168 views
...