krukut
New Coder
This is my program, so I found that if I input n>480 the program wouldn't output any solution, so how do I express it and print "No Output" in this program
Im still a newbie and trying to learn C programming.. Thanks for the help!
#include <stdio.h>
main()
{ int x,y,z,n;
scanf("%d",&n);
for(x=0;x<=n;x++)
for(y=0;y<=n;y++)
for(z=0;z<=n;z++)
if(5*x+2*y+0.1*z==120&&x+y+z==n)
printf("%d,%d,%d\n",x,y,z);
}
Im still a newbie and trying to learn C programming.. Thanks for the help!
#include <stdio.h>
main()
{ int x,y,z,n;
scanf("%d",&n);
for(x=0;x<=n;x++)
for(y=0;y<=n;y++)
for(z=0;z<=n;z++)
if(5*x+2*y+0.1*z==120&&x+y+z==n)
printf("%d,%d,%d\n",x,y,z);
}