INTELLIGENCE BUREAU I
Intelligence Bureau I
The Intelligence Bureau (IB) is India's internal intelligence agency. It was recast as the Central Intelligence Bureau in 1947 under the Ministry of Home Affairs. In 1909, the Indian Political Intelligence Office was established in England in response to the development of Indian revolutionary activities, which came to be called the Indian Political Intelligence (IPI) from 1921. This was a state-run surveillance and monitoring agency. The IPI was run jointly by the India Office and the Government of India and reported jointly to the Secretary of the Public and Judicial Department of the India Office, and the Director of Intelligence Bureau (DIB) in India, and maintained close contact with Scotland Yard and MI5.
The Assistant Central Intelligence Officer(ACIO) exam is conducted every year in which the exam fees differ for men,women and sc/st.
Let A denote the exam fees for women. Let B denote the exam fees for sc/st. Let C denote the exam fees for men.
The exam fees of a candidate is said to be valid, only when it satisfies any one of the conditions given below :
1. The exam fees of women should differ from the exam fees of sc/st by at most 100 and the exam fees of men should differ from both other values by more than 1000.
2. The exam fees of women should differ from the exam fees of men by at most 100 and the exam fees of sc/st should differ from both other values by more than 1000.
[Differ --- it may either be less than or more than]
Function Specification:
Given 3 ints, A, B, C, write a function named “findValidity” that accepts 3 integer arguments (A, B, C),. This function returns 1, if B or C is "close" (differing from A by at most 100), while the other is "far", differing from both other values by more than 1000.
Input Format :
Input consists of 3 integers that correspond to A, B and C.
Output Format :
Output consists of a string that is either “Valid” or “Invalid”.
Sample Input 1:
200
120
2000
Sample Output 1:
Valid
Sample Input 2:
120
1000
200
Sample Output 2:
Invalid
#include
#include
int findValidity(int A,int B,int C);
int main()
{
int a,b,c,ans;
scanf("%d%d%d",&a,&b,&c);
ans=findValidity(a,b,c);
if (ans==1)
{
printf("Valid\n");
}
else
printf("Invalid\n");
return 0;
}
int findValidity(int A,int B,int C)
{
if(((A-B<=100)&&(B-A<=100)&&(C-A>1000)&&(C-B>1000))||((A-C<=100)&&(C-A<=100)&&(B-A>1000)&&(B-C>1000)))
return 1;
else
return 0;
}
Comments
Post a Comment