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.
Answers
Answer:
Explanation:
Program for it is as below.
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.
#include <stdio.h>
void main()
{
int a=0, b=0, c=0;
printf("Input 3 numbers :- ");
scanf("%d%d%d",&a,&b,&c);
printf("%c",(a==b)?'0':(c==a)?'0':(c==b)?'0':'1',);
}
PROGRAM
The C++ program for your question is as follows :-
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int a,b,c;
cout<<"Enter three integer values"<<endl;
cin>>a>>b>>c;
if((a==b)||(a==c)||(b==c))
{
cout<<" Output = 0"<<endl;
}
else
{
cout<<"Output = 1"<<endl;
}
getch();
}
Related Questions :-
https://brainly.in/question/13084271
https://brainly.in/question/6172559
https://brainly.in/question/4430555
https://brainly.in/question/15807309
https://brainly.in/question/14581229