خواستم بگم:
do{
printf("Enter a number that you want to live on earth\n");
scanf("%f",&age);
for (i=0;i<=age;i++)
(float) printf("Happy brithday, You now have %f years old!\n",i);}
while (age!=0);
دیدم اینطور فایده نداره، زندگی تکراری میشه، اصلاح کردم:
printf("Enter an number that you want to live on earth\n");
scanf("%d",&age);
for (i=0;i<=age;i++)
printf("Happy brithday, You now have %d years old!\n",i);
دیدم حال نمیده، اگه بدونم چندسال زنده ام که زندگی اصلا هیجانین داره، مجبور شدم:
#include
main() {
float i,when_god_want;
for (i=0;i<=when_god_want;i++)
(float) printf("Happy brithday, You now have %f years old!\n",i);
printf("Alone-Man died on %d\nAlone-Man never forget his Wish!",i);
}
اینجوری خیلی بهتر شد :).