I wonder what's the final values of the variables "a, b and c" after this program... It is in pseudocode....
start
a = 2
b = 4
c = 10
while c > 6
perform changeBandC()
endwhile
if a = 2 then
perform changeA()
endif
if c = 10 then
perform changeA()
else
perform changeBandC()
endif
print a, b, c
stop
changeBandC()
b = b + 1
c = c - 1
return
changeA()
a = a + 1;
b = b - 1;
return
I tried to code to it...But nothing is printed...
I'll post it to ask you people what's wrong with my codes?
Here's my program...
#include <stdio.h>
int changeBandC(int,int);
int changeA(int,int);
int main()
{
int a = 2;
int b = 4;
int c = 10;
while (c > 6)
{
changeBandC(b,c);
}
if (a == 2)
changeA(a,b);
if (c == 10)
changeA(a,b);
else
changeBandC(b,c);
printf("%d,%d,%d",a,b,c);
getchar();
getchar();
}
int changeBandC(int b,int c)
{
int changeBandC = 0;
b = b + 1;
c = c - 1;
return changeBandC;
}
int changeA(int a,int b)
{
int changeA = 0;
a = a + 1;
b = b - 1;
return changeA;
}
I hope you could help me with this...
Thanks in advance...