All pastes #677017 Raw Edit

Miscellany

public text v1 · immutable
#677017 ·published 2007-08-31 16:28 UTC
rendered paste body
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