Program executed successfully but it doesn't continue. Please help. It works when I take y or n as character.
#include <stdio.h>
#include <conio.h>
int main()
{
int a[20], n, i, sum = 0;
char c[10];
clrscr();
do
{
printf("How many numbers you want to sum: ");
scanf("%d", &n);
for (i = 0; i < n; i++)
{
printf("\nwrite the number: ");
scanf("%d", &a[i]);
sum = sum + a[i];
}
printf("\nSum of numbers are %d", sum);
printf("\nDo you want to continue. yes or no: ");
scanf("%s", c);
} while (c == "yes");
if (c == "no")
printf("\nThanking You");
else
printf("\nWrong choice selected. Please select correct one");
return 0;
getch();
}
The error is shown below. How many numbers you want to sum: 3
write the number: 1
write the number: 2
write the number: 3
Sum of numbers are 6 Do you want to continue. yes or no: yes
Wrong choice selected. Please select correct one [Program finished]