Print numbers Without Semicolon in code With C

Code Snippets 4 U
#include < stdio.h > 
#include < stdlib.h >

  int main(int num, char * arr[]) {
    while (printf("%d\n", num++) != 4) {}

  }

This is happening because printf returns the number of characters printed.So we want to print upto three characters and plus new line character.So the loop will run until the printf does
return 4.

Leave a Reply

Your email address will not be published. Required fields are marked *

fifty one + = 58