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 190 views
1 answer 163 views
1 answer 243 views
4 answers 578 views
1 answer 132 views
132 views asked Jun 6, 2023 by avibootz
1 answer 119 views
119 views asked Oct 12, 2020 by avibootz
1 answer 4,014 views
...