Created
April 26, 2021 17:43
-
-
Save btechmag/3dfb474734df9e55894ab3d506bdcee8 to your computer and use it in GitHub Desktop.
C Program that accepts 4 integers p, q, r, s from the user where r and s are positive and p is even. If q is greater than p and if the sum of r and s is greater than the sum of p and q print "Correct values", otherwise print "Wrong values".
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
int main() | |
{ | |
int p, q, r, s; | |
printf("Input the first integer: "); | |
scanf("%d", &p); | |
printf("Input the second integer: "); | |
scanf("%d", &q); | |
printf("Input the third integer: "); | |
scanf("%d", &r); | |
printf("Input the fourth integer: "); | |
scanf("%d", &s); | |
if(q > r && s > p && ((r+s) > (p+q)) && (r > 0) && (s > 0) && (p%2 == 0)) | |
{ | |
printf("CORRECT VALUES"); | |
} | |
else | |
{ | |
printf("WRONG VALUES"); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment