0

c progreaming

Write a program to read a positive integer number 'n' and generate the numbers in the following way. If entered number is 3, the output will be as follows: 9 4 1 0 1 2 3

6th Mar 2021, 8:07 AM
Gaurav Karadbhajane
Gaurav Karadbhajane - avatar
1 Réponse
+ 1
Gaurav Karadbhajane Where is your attempts? Try this for (int i = -n; i <= n; i++) { if (i >= 0) printf ("%d ", i); else printf ("%d ", i * i); }
6th Mar 2021, 8:11 AM
A͢J
A͢J - avatar