Print 1 to 10 number without using semicolon in C .



Print 1 to 10 number without using semicolon in C:-

Every statement in C must end with a semicolon as per basics. However there are few scenarios when we can write a running program without semicolon.

But using Command Line Argument We Can Solve This Problem.

Here is the Ans


Ans:-#include<stdio.h> 

#define N 10 

int main(int num, char *argv[])
{
while (num <= N && printf("%d ", num) && num++) 
{


}


Output:_1 2 3 4 5 6 7 8 9 10

Post a Comment

1 Comments