All pastes #677198 Raw Edit

Miscellany

public text v1 · immutable
#677198 ·published 2007-08-31 19:43 UTC
rendered paste body
#include <stdio.h>

int main (void)

{
	int nr1;
	int nr2;
	int result;
	char todo [9];
        printf("nr1\n");
        scanf("%d", &nr1);
        printf("nr2");
		scanf("%d", &nr2);
		printf("what to do ? add,multiply,substract,divide");
		scanf("%s", &todo);
		
	if (todo == add)
	{
		result = nr1 + nr2;
		printf("%d", result);
	}
	if (todo == multiply)
	{		
		result = nr1 * nr2;
		printf("%d", result);
	}
	return 0;
}


errors :p 


c:17: error: ‘add’ undeclared (first use in this function)
c:17: error: (Each undeclared identifier is reported only once
c:17: error: for each function it appears in.)
c:22: error: ‘multiply’ undeclared (first use in this function)