Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- long long unsigned int zahl,zielzahl,zahlmenge,pruefzahl=0;
- long long int binaervergleich=1;
- long long unsigned int summe =0;
- long long unsigned int *sp;
- printf("Enter a number: ");
- scanf("%lld",&zahl);
- printf("\nEnter the number to count to: ");
- scanf("%lld",&zielzahl);
- zahlmenge = zielzahl-zahl;
- printf("\n%lld Numbers to test\n\n",zahlmenge-1);
- pruefzahl = pruefzahl + zahl;
- summe = zahl;
- for (pruefzahl = pruefzahl+1;pruefzahl <= zahlmenge;pruefzahl++){
- if ((pruefzahl&binaervergleich) == 1 ){
- sp = &summe;
- printf("%lld is uneven\nwill add to number:%lld the value:%lld ",pruefzahl,*sp,pruefzahl);
- *sp = *sp + pruefzahl;
- printf("result=%lld\n",summe);
- }
- else{
- printf("%lld is even\n",pruefzahl);
- }
- }
- printf("\nSum of all additions:%lld",summe);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement