missing number code example
Example: missing number
#include <stdio.h>
int main(){
int n;
int total = 0;
printf("How many numbers do you want to enter : ");
scanf("%d",&n);
int i =1;
while(i<=n){
printf("Enter your number %d : ",i);
int array;
scanf("%d",&array);
total +=array;
++i;
}
n++;
int sub = ((n + 1) * (n)) / 2;
printf("%d",(sub-total));
}