“während Schleife c” Code-Antworten

tun ... während Schleife c

// Program to add numbers until the user enters zero

#include <stdio.h>
int main() {
  double number, sum = 0;

  // the body of the loop is executed at least once
  do {
    printf("Enter a number: ");
    scanf("%lf", &number);
    sum += number;
  }
  while(number != 0.0);

  printf("Sum = %.2lf",sum);

  return 0;
}
SAMER SAEID

während Schleife c

// Print numbers from 1 to 5

#include <stdio.h>
int main() {
  int i = 1;
    
  while (i <= 5) {
    printf("%d\n", i);
    ++i;
  }

  return 0;
}
SAMER SAEID

C während der Schleife

while (testExpression) {
  // the body of the loop 
}
SAMER SAEID

C tun ... während Schleife

do {
  // the body of the loop
}
while (testExpression);
SAMER SAEID

Ähnliche Antworten wie “während Schleife c”

Fragen ähnlich wie “während Schleife c”

Weitere verwandte Antworten zu “während Schleife c” auf C

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen