Mistaken -- Comprehension

Source: Internet
Author: User

Computer content: Verify the "Double int" syntax rules

Objective: To learn how to use "hit error" to understand syntax requirements

/*

* Copyright (c) 2012, computer College, Yantai University

* All Rights Reserved.

* Author: Liu Mingliang

* Completion date: January 1, 2012
October 18

* Version: V1.0

*

* Input Description: None

* Problem description: design a program that contains errors, verify the "Double int" syntax rules, and learn the "hit error" method.

* Program output: Remainder

* Problem Analysis: \ maximum value, \ cpp1.cpp (6): Error c2296: '%': illegal, left operand has type 'double'
D: \ calculate the maximum value, \ cpp1.cpp (6): Error c2297: '%': illegal, right operand has type 'double'
Error executing cl.exe.

Cpp1.obj-2 error (s), 0 warning (s)

* Algorithm Design: # include <iostream>
Using namespace std;
Int main ()
{
Int a = 7, B = 4, c;
C = a % B;
Cout <c <endl;
Return 0;
}

Result (screenshot ):

 

Observe and understand my summary: Although I already know the results in advance, I am more impressed with the actual operation.

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.