You will be given 3 integers as input

+1 vote
asked Aug 4, 2019 by athira (190 points)

You will be given 3 integers as input. The inputs may or may not be
 different from each other. 

You have to output 1 if all three inputs
 are different from each other, 
and 0 if any input is repeated more
 than once.



Input
-----
Three integers on three lines.



Output
------
1 if the three inputs are different from each other
, 0 if some input is repeated more than once

1 Answer

0 votes
answered Aug 5, 2019 by lata (220 points)
#include<stdio.h>
void main()
{
    int a,b,c;
    scanf("%d %d %d",&a,&b,&c);
    if(a==b||a==c||b==c)
    printf("1");
    else
    printf("0");
}
commented Aug 8, 2019 by anonymous
Check your conditions properly. This is wrong.
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...