Answers for "missing number in c"

0

missing number in c

#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));
}
Posted by: Guest on June-11-2021

Code answers related to "missing number in c"

Browse Popular Code Answers by Language