All pastes #266798 Raw Edit

Stuff

public text v1 · immutable
·published 2006-12-04 11:26 UTC
rendered paste body
//Daniel Pfeil
//Quersumme
//25.09.2006

#include <conio.h>
#include <iostream.h>

int main()
{
	int qs=0;
	int zahl=0;
   int rest=0;
	cout << "Zahl eingeben:\n";
   cin >> zahl;//zahl einlesen

	do{
      rest=zahl%10;
      qs=qs+rest;
      zahl=zahl/10;
	}while(zahl>0);//Abbruch, wenn zahl = 0 ist
   cout << "\nQuersumme: ";
	cout << qs;
   getch();
   return 0;
}