This repository has been archived on 2023-10-26. You can view files and clone it, but cannot push or open issues or pull requests.
VSMechatronics/Lectures/LC8/ComplexIf/complex_if.c

36 lines
537 B
C
Raw Permalink Normal View History

/* MMME3085 Chapter 8 */
2022-04-07 15:58:01 +00:00
/* Example of a simple if statements */
#include <stdio.h> /* Standard include files */
#include <stdlib.h>
#include <conio.h>
int main( void )
{
int a = 1, b = 6; // Define and intialise variables
if ( (a == 1 ) && ( b == 6 ) )
{
printf("a is 1 AND b is 6\n" );
}
if ( (a == 1 ) || ( b == 99 ) )
{
printf("a is 1 OR b is 99\n" );
}
if (( b < a ) || ( a == 7 ) )
{
printf ("The value of b is less than a OR a is 7\n");
}
return 0;
}