File: testBug.cpp

package info (click to toggle)
between 6%2Bdfsg1-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, jessie, jessie-kfreebsd, stretch
  • size: 3,532 kB
  • sloc: cpp: 28,110; php: 718; ansic: 638; objc: 245; sh: 236; makefile: 99; perl: 67
file content (21 lines) | stat: -rw-r--r-- 401 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <stdio.h>

int main() {

    int A = 2;
    int B = 1;

    while( B != A ) {
        printf( "Start of loop, A=%d, B=%d\n", A, B );

        A = B;
        printf( "Set A = B, so now A=%d, B=%d\n", A, B );

        B = 0;
        printf( "Set B = 0, so now A=%d, B=%d\n", A, B );
        }
    
    printf( "Loop ended because A and B equal, with A=%d, B=%d\n", A, B );

    return 0;
    }