A 108 : Add Two Variables - II HackerRank Answer

Instead of directly adding the numbers, we can also store the sum in another variable.

To complete this task you need to store the sum of two variables var1 and var2 in a third variable called answer.

NOTE : You are expected to fix any other errors that you come across.

Sample Output 0

250
Source Code
#include <stdio.h>

int main()
{
	int var1 = 100;
	int var2 = 150;
    int answer;
	//Declare a variable answer here and store in it
	//The sum of var1 and var2.
    answer=var1+var2;

	printf("%d", answer);
	return 0;
}

Comments