Created
January 9, 2016 08:42
-
-
Save jmramirezpro/48c7f4dbb6d96ff33846 to your computer and use it in GitHub Desktop.
Ejercicios del Podcast Codigo Fuente - Programa 16
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
/* | |
* OperacionesLogicas.c | |
* Ejercicios del Podcast Codigo Fuente - Programa 16 | |
* Programa que hace operaciones lógicas | |
* Creado el 01 de ene. de 2016 | |
* Author: jmramirez | |
*/ | |
#include <stdio.h> | |
#define TRUE 1 | |
#define FALSE 0 | |
int main (void) | |
{ | |
int i = 5, j= 4; | |
int aux; | |
/* Operadores lógicos con booleanos */ | |
printf ("\n Operaciones lógicas ... "); | |
printf ("\n NOT TRUE es %d", !TRUE ) ; | |
printf ("\n NOT FALSE es %d", !FALSE ); | |
aux = TRUE && FALSE; | |
printf ("\n TRUE AND FALSE es %d", aux); | |
aux = TRUE || FALSE; | |
printf ("\n TRUE OR FALSE es %d", aux); | |
/* Operadores relacionales */ | |
printf ("\n \n Mayor o igual que ..."); | |
printf ("\n ( i >= j) = %d", ( i >= j)); /* true */ | |
printf ("\n ( j >= i) = %d", ( j >= i)); /* false */ | |
printf ("\n ( i != j) = %d", ( i != j)); /* true */ | |
/* Operadores lógicos con enteros */ | |
printf ("\n \n Operaciones logicas con enteros ... " ) ; | |
printf ("\n NOT(i >= j) = %d", !(i >= j)); /* false */ | |
aux = (i >= j) && (j >= i) ; | |
printf("\n (i >= j) AND (j >= i) = %d", aux); /* false */ | |
aux = (i >= j) || (j >= i) ; | |
printf( "\n (i >= j) OR (j >= i) = %d \n \n", aux); /* true */ | |
return(0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment