galley that part " if ((S%10=0) && (S<Vt))" is not going

Asked

Viewed 48 times

-2

#include<stdio.h>
main()
{
char R[1];
int S, SQ, Nc, Vt;
   Nc=1000;
   Vt=10000;
   SQ=S/10; 
    while(R!="N" || Nc>0)
    {
    printf("limite:%d",Vt);
    printf("\nDigite quanto deseja sacar:");
    scanf("%d",&S);
    if ((S <0) || (S > Vt) || (S % 10 != 0))
    printf("Valor invalido");
    printf("Deseja realizar outro saque? [S/N]");
    scanf("%s",&R);
    if ((S%10=0) && (S<Vt))
    printf("%d nota(s) de 10.", SQ);
    printf("Deseja realizar outro saque? [S/N]");
    scanf("%s",&R);
    Vt=Vt-S;
    Nc=Nc-(S/10);
    if (Nc = 0)
    printf("Sem notas");
}
}
  • Isn’t one missing = in this comparison?

  • Hello @Pedro Sabença Welcome to Sopt, before posting your questions check out https://answall.com/tour and https://answall.com/help/minimal-reproducible-example

  • correct the indentation of your code, to facilitate the understanding of other people

2 answers

1

In the language C you have to use 2 equal in comparison. In this case it would be: if (s%10 == 0 && s < vt)

0


You have to put another equal sign on that if, getting so if ((S%10==0) && (S<Vt))

  • Thank you very much!

  • If solved, mark the answer as correct and upvote on the answers that have helped you in any way. This helps anyone who has a similar problem in the future.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.