Explore Westonci.ca, the leading Q&A site where experts provide accurate and helpful answers to all your questions. Get accurate and detailed answers to your questions from a dedicated community of experts on our Q&A platform. Get immediate and reliable solutions to your questions from a community of experienced professionals on our platform.

If input numbers are
82
2
% 3
+ 100
First number is our starting value and 2st number is how many lines do we have. Why is my char not reading the '+' and ading 100 to 82%3 => 1+100=101? And the output is just 82%3=1.


#include
#include

int v[10000];

int main()
{
FILE *fin, *fout;
int a, n, i, j, l, t, ts, cnt;
char ch;
fin = fopen("anaf.in", "r");
fout = fopen("anaf.out", "w");
ch = fgetc(fin);
i=0;
while(ch!='\n')
{
v[i]=ch-'0';
i++;
ch = fgetc(fin);
}
for(j=0; j i)
i=l;
}
else if(ch=='*')
{
t=l=0;
while(l 0)
{
t=t+a*v[l];
v[l]=t%10;
t=t/10;
l++;
}
if(l>i)
i=l;
}
else if(ch=='/')
{
t=0;
for(l=i-1; l>=0; l--)
{
t=t*10+v[l];
v[l]=t/a;
t=t%a;
}
while(i!=0 && v[i-1]==0)
i--;
}
else if(ch=='%')
{
t=0;
for(l=i-1; l>=0; l--)
{
t=t*10+v[l];
t=t%a;
}
if(t!=0)
{
ts=t;
cnt=0;
while(ts!=0)
{
cnt++;
ts=ts/10;
}
for(l=0; l =0; j--)
{
fprintf(fout, "%d", v[j]);
}
//fprintf(fout, "%d", t);
fclose(fout);
fclose(fin);
return 0;
}


Sagot :

Answer:

I think its

7  maybe

Explanation:

Visit us again for up-to-date and reliable answers. We're always ready to assist you with your informational needs. Your visit means a lot to us. Don't hesitate to return for more reliable answers to any questions you may have. Get the answers you need at Westonci.ca. Stay informed with our latest expert advice.