Donghua software test, Donghua written test

Source: Internet
Author: User

Donghua software test, Donghua written test

1. switch statement execution process: starting from the first matching condition, all the code behind it is executed until it is completed or break is encountered;

#include<stdio.h>int main(){int x = 1,a = 0,b = 0;switch(x){case 0:b++;case 1:a++;case 2:a++,b++;}printf("%d %d\n",a,b);return 0;}
Output result: 2 1


2. logic operator operation rules:

A & B judge B when A is true. When A is false, the final result is false;

A | B determines B when A is false. When A is true, the final result is true;

# Include <stdio. h> int main () {int I = 1, j = 2, k = 3; if (I ++ = 1 & (++ j = 3 | k ++ = 3 )) {// k ++ and run printf ("% d \ n", I, j, k) ;}return 0 ;}
Output result: 2 3 3

3. Differences between sizeof () and strlen ()

Sizeof () calculates the memory size occupied by an object

Strlen () is used to evaluate the length of a character array. If \ 0 is used to determine that the string ends, \ 0 is not included in the length.

#include<stdio.h>#include<string.h>int main(){char a[7] = "a0\0a0\0";int x,y;x = sizeof(a);y = strlen(a);printf("%d %d\n",x,y);return 0;}
Output result: 7 2




JAVA pen questions of Donghua software Co., Ltd.

Don't go to fuck me. I have a trainee there, and I didn't pay any salary for two months after I went there on January 5. I can't afford my rent. Someone resigned every day and you are still there!
 
Donghua software Co., Ltd. (Shunde)

Don't come to Donghua software, family business, no future. The technology can be exhausted. If you are on a business trip twice a year or half a year, you are either on a business trip or on a business trip. Wages are still low, especially in second-tier cities like this. Although there is a subsidy for a business trip, it is also low, not to mention that some people have not provided a subsidy for a business trip for 10 years.

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.