How to stop a program in C

3 Answers

0 votes
#include <stdio.h>

int main() {
    printf("abc");
    
    return 0;
    
    printf("xyz");

    return 0;
}


/*
run:

abc

*/

 



answered May 18 by avibootz
0 votes
#include <stdio.h>
#include <stdlib.h>

int main() {
    printf("abc");
    
    exit(EXIT_SUCCESS);

    printf("xyz");

    return 0;
}


/*
run:

abc

*/

 



answered May 18 by avibootz
0 votes
#include <stdio.h>
#include <stdlib.h>

int main() {
    printf("abc");
    
    abort();

    printf("xyz");

    return 0;
}


/*
run:

Aborted

*/

 



answered May 18 by avibootz

Related questions

1 answer 78 views
1 answer 31 views
31 views asked May 18 by avibootz
1 answer 41 views
41 views asked May 19 by avibootz
1 answer 40 views
40 views asked May 19 by avibootz
1 answer 56 views
56 views asked May 19 by avibootz
1 answer 52 views
...