With out looping statements and condition operators.....
C program i need to print 1 to 100 without using loop(ex:while do while, for statements and condition (Ex :if
you can use go to statement for this, and ternary operator instead of if condition.
void main()
{
int i;
i=1;
loop:
printf("%d", i)
(i%26lt;100)? i++: return 0;
go to loop;
}
Reply:std::cout %26lt;%26lt; "1,2,3,....100"%26lt;%26lt;std::endl;
or
system("iota 1 100");
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment