3
#include <stdio.h>
#include <stdlib.h>
int main()
{
int num1, num2, num3;
printf("Digite o numero A e numero B para saber o resto da divisao resultante da divisao entre eles:\n");
printf("NumeroA: "); scanf("%i\n", num1);
printf("\n");
printf("NumeroB: "); scanf("%i\n", num2);
printf("O resto da divisao e: %i", num1 % num2);
return 0;
}
Instead of printing the rest, OS prints the first, the second printf()
and the scanf()
.
What am I doing wrong?
I would also like to know how I can indicate a variable in a printf()
(as I know Python I will try to explain and if anyone knows I think you can understand)
n = int(input("Digite um numero: "))
m = int(input("Digite outro numero: "))
print (" Imprimiu o numero {} e {}".format(n, m))
I’m new and in this and I’m only 15 D, use accessible language please.
I’m learning from Youtube through the playlist C course: http://www.youtube.com/playlist?list=PLesCEcYj003SwVdufCQM5FIbrOd0GG1M4 recommends something better?
– Tiago Gonçalves
I recommend well-known books or courses. These classes look bad. See https://answall.com/tags/c/info.
– Maniero