code:
#include <stdio.h>
int main (void)
{
int nr1;
int nr2;
char [8] todo;
int result;
printf("nr1 pls\n");
scanf("%d", &nr1);
printf("nr2 pls\n");
scanf("%d", &nr2);
printf("What do u want to do? (add)\n");
scanf("%s", &todo);
if (todo == add)
{
result = nr1 + nr2;
printf("%d\n" result;
}
}
errors:
error: expected identifier or ‘(’ before numeric constant
error: ‘todo’ undeclared (first use in this function)
error: (Each undeclared identifier is reported only once
error: for each function it appears in.)
error: ‘add’ undeclared (first use in this function)
expected ‘)’ before ‘result’
error: expected ‘;’ before ‘}’ token