I cant seems to get the answer of the program below, I try to create a program where the user input 10 numbers and the first 5 numbers in the arrays will then deduct with the next last 5 numbers in the arrays.
Code:
#include<stdio.h>
#include<conio.h>
#include<ctype.h>
#include<stdlib.h>
#include<string.h>
void Difference();
main(){
Difference();
fflush(stdin);
return 0;
}
void Difference(){
int intarr[10];
int i;
int answer;
do
{
printf("Please enter the number :");
scanf("%d",&intarr[i]);
i++;
}
while(i<10);
answer=(intarr[0]+intarr[1]+intarr[2]+intarr[3]+intarr[4])-(intarr[5]+intarr[6]+intarr[7]+intarr[8]+intarr[9]);
printf("Your answer", answer);
getch();
clrscr();
}