Discover answers to your questions with Westonci.ca, the leading Q&A platform that connects you with knowledgeable experts. Our platform provides a seamless experience for finding reliable answers from a network of experienced professionals. Explore comprehensive solutions to your questions from knowledgeable professionals across various fields 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:

We appreciate your time. Please come back anytime for the latest information and answers to your questions. We hope our answers were useful. Return anytime for more information and answers to any other questions you have. Thank you for trusting Westonci.ca. Don't forget to revisit us for more accurate and insightful answers.