Missing Number

You are given an array A of N integers containing distinct elements from 1 to N+1, except for one el…

Click here to read the complete problem statement.


If you need help solving this problem, mention your approach and ask specific questions. Please avoid sharing your code and asking the Community to figure out “what’s wrong”.

#include <stdio.h>

int main() {
	int a,b,c,d,e;
	scanf("%d",&a);
	scanf("%d,%d,%d",&b,&c,&d);
	e=b+c+d;
	printf("%d",a-e);
	return 0;
}

what is my problem

scanf("%d,%d,%d",&b,&c,&d);
         ^  ^ this commas
1 Like

you have to declare ‘a-e’ in another line

Why do you think so?

you should not use comma between %d.
(“%d %d %d”,&b,&c,&d); >>this the correct form.

#include <stdio.h>

int main() {
int a,b,c,sum,d;
scanf(“%d”,&sum);
scanf(“%d %d %d”,&a,&b,&c);
d=sum-(a+b+c);
printf(“%d”,d);
return 0;
}

after submitting , it says running 0/6 . what’s this ?

I have solved more than 5 problems … but in my profile still showing 0 problem solved… Whats the problem ?