Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // aufgabe19.cpp : Definiert den Einstiegspunkt für die Konsolenanwendung.
- //
- #include "stdafx.h"
- int _tmain(int argc, _TCHAR* argv[])
- {
- int values[2] = {0};
- printf("Bitte geben Sie den Startwert ein:");
- scanf("%d", &values[0] );
- printf("Bitte geben Sie den Stopwert ein:");
- scanf("%d", &values[1] );
- int i = 1;
- if(values[0] > values[1]) {
- i = -1;
- }
- if(values[0] == values[1]) {
- printf("%d\n", values[1]);
- return 0;
- }
- while(values[0] != values[1]) {
- printf("%d,\n", values[0]);
- values[0] += i;
- }
- printf("%d\n", values[1]);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment