How about this version in C, from a programmer's point of view?
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main()
{
const char* const msgs[] =
{ "Correct!", "Congrats!", "That's the right answer!" };
const int msgsAmount = sizeof(msgs)/sizeof(msgs[0]);
srand(time(0));
int n1 = 1 + rand() % 10, n2 = 1 + rand() % 10, answer;
printf("Add these two numbers together: %d and %d\n", n1, n2);
scanf("%d", &answer);
if(answer == n1+n2) printf("%s\n", msgs[rand() % msgsAmount]);
else printf("Sorry, that's incorrect.\n");
return 0;
}
(Not that this code is perfect from design point of view, but you should usually try to minimize the amount of conditionals and instead try to make things more generic. In this case an array makes it a lot easier to eg. add new possible congrat messages, or delete existing ones, by simply adding/removing them from the array, without having to write more conditionals for each one.)