C-language branching and cyclic recursive thinking

Source: Internet
Author: User

Conditional statements

Switching control Statements (switch statements)

Like an elevator, a break is a floor that is pressed, and will be executed without break.

The above program has detailed bug, boundary test input-5,105, because the integer division will get the wrong result.

Workaround:

Cycle

The difference between a type loop and a to-type loop is whether the condition is true at first execution

About the comma operator

Recursive

Forward recursive and reverse recursion

#include <stdio.h>intMain () {intX,n; N=1; X=1;  while(n<=9)//need to be pushed 9 times{x=2* (x+1); N++; } printf ("x=%d", x);    GetChar ();    GetChar (); return 0;}
View Code

Fibonacci Naxi Series

C-language branching and cyclic recursive thinking

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.