Write a program to print numbers from 1 to N without using a semicolon.
Example:
Input: N = 8
Output: 1 2 3 4 5 6 7 8
Approach
C
#include <stdio.h>#define N 8int main(int num, char *argv[]){while (num <= N && printf("%d ", num) && num){num++;}}
No comments:
Post a Comment