How to use puts() return value in C

1 Answer

0 votes
#include <stdio.h>
 
int main() {
    int result = puts("C Programming");
     
    printf("The total printed characters are: %d\n", result);
     
    if (result == 14) {
        puts("OK");
    }
}
 
 
 
/*
run:
 
C Programming
The total printed characters are: 14
OK
 
*/

 



answered Jun 6, 2023 by avibootz

Related questions

1 answer 186 views
1 answer 160 views
1 answer 239 views
4 answers 569 views
1 answer 127 views
127 views asked Jun 6, 2023 by avibootz
1 answer 117 views
117 views asked Oct 12, 2020 by avibootz
1 answer 4,008 views
...