Life, the Universe, and Everything C Program

How to write a c program Life, the Universe, and Everything C Programming Language ?


 
Solution:
#include <stdio.h>
   
    int main ()
    {
    int a,i=0,n;
 
    while (1)
    {
    scanf("%d", &a);
    if(a==42)
        break;
    else
        printf("%d\n", a);
    }
    return 0;
    }


Learn More :