Я делаю этот простой код, где, если я ставлю два числа, и он показывает решение. Это код:Ошибка не была объявлена в этой области
#include <stdio.h>
int main()
{
printf("Enter two numbers:")
;scanf("&d &d", a, b)
;printf("=======================\n"); /* */
/* */
printf("The sum of %d and %d is %d.\n\n", 3, 4, 3 + 4)
/* */
;printf("The difference of %d and %d is %d. \n\n", 3, 4, 3-4)
/* */
;printf("The product of %d and %d is %d. \n\n", 3, 4, 3*4)
/* sum of squares would be a*a + b*b */
;printf("The sum of the squares of %d and %d is %d. \n\n", 3, 4, 3*3 + 4*4)
;printf("**end**"); /* :-) */
;return (0);
}
, и я получаю сообщение об ошибке, которая говорит:
[Error] 'a' was not declared in this scope
and
[Error] 'b' was not declared in this scope
Что случилось с ним?
необходимо объявить их, как говорится. как «int a, b;» –
Интересный стиль: _ (. – this
Вам нужно объявить переменные a и b, прежде чем пытаться хранить что-либо в них. – tylerism