C-Language Basic learning operator-relational operator

Source: Internet
Author: User

Compare size

First, we need to look at the Boolean type first. The C99 standard for the C language supports Boolean types, and the keyword is _bool, which is used to represent the logical value TRUE and false. the C language uses a value of 1 to indicate true and a value of 0 for false. So a Boolean type is actually an integer type.

Programs often use expressions that contain relational operators for branching and looping operations. We will learn specifically in the chapters of branching and looping.

The C language provides 6 relational operators, as follows:

Let's look at a simple example:

#include <stdio.h>  int main (void)  {       int5;       int 3 ;         /* based on the actual values of the variable A and variable B, write the correct relational operator in the middle of a and B, so that the     expression returns a value of 1 (in the C language, true)*/      printf (  "%d\n", a! = b)      ; return 0 ;  }  

More learning content, just in the code bud Net

Http://www.mayacoder.com/lesson/index

The result of this code brush, of course, is 1 ~

C-Language Basic learning operator-relational operator

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.