Table of Contents

Selection Test 1

Adapted by Neilor Tonin, URI  Brazil | Timelimit: 1

Read 4 integer values A, B, C and D. Then if B is greater than C and D is greater than A and if the sum of C and D is greater than the sum of A and B and if C and D were positives values and if A is even, write the message “Valores aceitos” (Accepted values). Otherwise, write the message “Valores nao aceitos” (Values not accepted).

Input

Four integer numbers A, B, C and D.

Output

Show the corresponding message after the validation of the values​​.

Input SampleOutput Sample
5 6 7 8Valores nao aceitos
2 3 2 6Valores aceitos

Solution

#include<stdio.h>
int main()
{  int A,B,C,D;

scanf("%d%d%d%d",&A,&B,&C,&D);
if((B>C)&&(D>A)&&((C+D>A+B))&&(C>=0&&D>=00)&&(A%2==0)){

printf("Valores aceitos\n");
}
else{
    printf("Valores nao aceitos\n");
}
    return 0;
}
Share on facebook
Facebook
Share on twitter
Twitter
Share on linkedin
LinkedIn
Share on pinterest
Pinterest
Share on whatsapp
WhatsApp
Share on email
Email
Md. Nurnobi Hosen
Md. Nurnobi Hosen

Student of Computer Science and Engineering at Daffodil International University,Main Campus ,Dhanmondi.
Web and App Developer also expart of wordpress customization

All Blog Posts »
Subscribe
Notify of
guest
1 Comment
Most Voted
Newest Oldest
Inline Feedbacks
View all comments
oprol evorter
oprol evorter
December 11, 2019 5:49 AM

Definitely believe that which you stated. Your favorite justification appeared to be on the internet the simplest thing to be aware of. I say to you, I definitely get irked while people think about worries that they just do not know about. You managed to hit the nail upon the top and also defined out the whole thing without having side effect , people can take a signal. Will probably be back to get more. Thanks

1
0
Would love your thoughts, please comment.x
()
x