#please help me with this
1 messages · Page 1 of 1 (latest)
When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.
@cobalt bear
Your message appears to contain screenshots but no code. Please send code and error messages in text instead of screenshots if applicable!
#include <stdio.h>
int main () {
int a,b,c,i;
do {printf("give 3 integrants (Between 0 and 50): ");
scanf("%d %d %d",&a,&b,&c);
if (a>b) {
int temp = a;
a = b;
b = temp;
}
if (a>c) {
int temp = a;
a = c;
c = temp;
}
if (b>c) {
int temp = b;
b = c;
c = temp;
}
} while (a<0 a>50 b<0 b>50 c<0 || c>50);
for (i=c;i<=a;i++) {
if (i%2==0) {
printf("%d",i);
}
}
return 0;
}
#1013104018739974194
also can some one write me an algoritme for it too pls
no one is going to wriite code for you either
use a while loop for validating id a is greater than b and b is greater than c
#include <stdio.h>
int main() {
int a, b, c, temp, min, max, i;
do {
printf("Entrez 3 entiers (entre 0 et 50) : ");
scanf("%d %d %d", &a, &b, &c);
if (a > b) {
temp = a;
a = b;
b = temp;
}
if (a > c) {
temp = a;
a = c;
c = temp;
}
if (b > c) {
temp = b;
b = c;
c = temp;
}
} while (a < 0 || a > 50 || b < 0 || b > 50 || c < 0 || c > 50);
min = a;
max = c;
printf("Les entiers triés sont : %d, %d, %d\n", a, b, c);
printf("Les entiers pairs entre %d et %d sont :\n", min, max);
for (i = min; i <= max; i++) {
if (i % 2 == 0) {
printf("%d\n", i);
}
}
return 0;
}
I did this and it worked fine
I also did it with if but that way boring so I just stuck to this format