Created
September 25, 2017 15:27
-
-
Save IanCarloz/9dd40b6514ad5ea779e8d5478b1404c8 to your computer and use it in GitHub Desktop.
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> | |
// Como funcionan los operadores de relacionales | |
/* | |
Observe el siguiente codigo y realice los cambios pertinentes | |
para que la salida muestre los operadores relacionales y los resultados | |
correctamente. | |
*/ | |
int main() | |
{ | |
int a, b, c; //= 5, b = 5, c = 10; | |
printf("dame el valor de a="); | |
scanf("%d", &a); | |
printf("dame el valor de b="); | |
scanf("%d", &b); | |
printf("dame el valor de c="); | |
scanf("%d", &c); | |
if (a == b) { | |
printf("hemos obtenido %d == %d \n", a, b); // true | |
} | |
if (a == c) { | |
printf("%d == %d \n", a, c); // false | |
} | |
if (a > b) { | |
printf("%d > %d \n", a, b); //false | |
} | |
if ( a > c) { | |
printf("%d > %d \n", a, c); //false | |
} | |
if (a < b) { | |
printf("%d < %d \n", a, b); //false | |
} | |
if (a < c) { | |
printf("%d < %d \n", a, c); //true | |
} | |
if (a != b) { | |
printf("%d != %d \n", a, b); //false | |
} | |
if (a != c) { | |
printf("%d != %d \n", a, c); //true | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment