What's new

C# Pa help po 1st year college plng ako

Step 1
use loop to print value of x and count.
set the initial value of x=6 and value of count=4.
display value of x and count.
if( value of x==8 )
x=x+2, count=count-2
otherwise x++,count--
end.
Step 2
#include <stdio.h>
int main()
{
int x=6, count=4;
while(1)
{
printf("\nx is %d and count is %d",x,count);
if(x==8)
{
x=x+2;
count=count-2;
printf("\nx is %d and count is %d",x,count);
break;
}
x++;
count--;

}
return 0;
}

840-271f-11ec-a5e9-2332dbb6d412_Screenshot%20(718).png
 

Attachments

Similar threads

Back
Top