Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
formatting tags
Source Link
UpAndAdam
  • 1.7k
  • 1
  • 3
  • 20

int c;
int i;
int k;


do
c = get_int ("c: ");
while (c < 0);
for (i = 0 ; c >= 5 ; i++)
{
c = c - 5;
}
int v = c;
for (k = 0 ; c >= 1 ; i++)
{
v = v -1 ;
}
printf("%i\n", i + k);


HereHere is my code to count the sum of 5 and 1 coin of a certain money to be the less. But I have to assign variable c to variable v because if not do so, the program will stop if the money is less than 5 in the first place. Can anyone tell me how I can get the value of variable c after a loop without assign it to another variable?

int c;
int i;
int k;

do
{
    c = get_int ("c: ");
} while (c < 0);

for (i = 0; c >= 5 ; i++)
{
    c = c - 5;
}

int v = c;
for (k = 0 ; c >= 1 ; i++)
{
    v = v -1 ;
}

printf("%i\n", i + k);

int c;
int i;
int k;


do
c = get_int ("c: ");
while (c < 0);
for (i = 0 ; c >= 5 ; i++)
{
c = c - 5;
}
int v = c;
for (k = 0 ; c >= 1 ; i++)
{
v = v -1 ;
}
printf("%i\n", i + k);


Here is my code to count the sum of 5 and 1 coin of a certain money to be the less. But I have to assign variable c to variable v because if not do so, the program will stop if the money is less than 5 in the first place. Can anyone tell me how I can get the value of variable c after a loop without assign it to another variable?

Here is my code to count the sum of 5 and 1 coin of a certain money to be the less. But I have to assign variable c to variable v because if not do so, the program will stop if the money is less than 5 in the first place. Can anyone tell me how I can get the value of variable c after a loop without assign it to another variable?

int c;
int i;
int k;

do
{
    c = get_int ("c: ");
} while (c < 0);

for (i = 0; c >= 5 ; i++)
{
    c = c - 5;
}

int v = c;
for (k = 0 ; c >= 1 ; i++)
{
    v = v -1 ;
}

printf("%i\n", i + k);

added 64 characters in body
Source Link

int c;  
int i;  
int k;

do
do c
c = get_int ("c: ");  
while (c < 0);  
for (i = 0 ; c >= 5 ; i++)  
{ c
c = c - 5;  
}  
int v = c;  
for (k = 0 ; c >= 1 ; i++)  
{ v
v = v -1 ;  
}  
printf("%i\n", i + k);

Here
Here is my code to count the sum of 5 and 1 coin of a certain money to be the less. But I have to assign variable c to variable v because if not do so, the program will stop if the money is less than 5 in the first place. Can anyone tell me how I can get the value of variable c after a loop without assign it to another variable?

int c; int i; int k;

do c = get_int ("c: "); while (c < 0); for (i = 0 ; c >= 5 ; i++) { c = c - 5; } int v = c; for (k = 0 ; c >= 1 ; i++) { v = v -1 ; } printf("%i\n", i + k);

Here is my code to count the sum of 5 and 1 coin of a certain money to be the less. But I have to assign variable c to variable v because if not do so, the program will stop if the money is less than 5 in the first place. Can anyone tell me how I can get the value of variable c after a loop without assign it to another variable?

int c;  
int i;  
int k;


do
c = get_int ("c: ");  
while (c < 0);  
for (i = 0 ; c >= 5 ; i++)  
{
c = c - 5;  
}  
int v = c;  
for (k = 0 ; c >= 1 ; i++)  
{
v = v -1 ;  
}  
printf("%i\n", i + k);


Here is my code to count the sum of 5 and 1 coin of a certain money to be the less. But I have to assign variable c to variable v because if not do so, the program will stop if the money is less than 5 in the first place. Can anyone tell me how I can get the value of variable c after a loop without assign it to another variable?

Source Link

How to get value of variable after a loop

int c; int i; int k;

do c = get_int ("c: "); while (c < 0); for (i = 0 ; c >= 5 ; i++) { c = c - 5; } int v = c; for (k = 0 ; c >= 1 ; i++) { v = v -1 ; } printf("%i\n", i + k);

Here is my code to count the sum of 5 and 1 coin of a certain money to be the less. But I have to assign variable c to variable v because if not do so, the program will stop if the money is less than 5 in the first place. Can anyone tell me how I can get the value of variable c after a loop without assign it to another variable?