MIT 6.189 A Gentle Introduction to Programming Using Python (OCW)22 Online
OpenStudy (anonymous):
hey everyone
i was wondering what's wrong with my program?
#include
int main () {
int a,b,c,d,e;
printf("enter five integers:\n");
scanf("%d%d%i%i%i" ,&d,&e ,&a,&b,&c);
if (a >b ,c ,d ,e) {
printf("%i is the largest\n" ,a);}
if (b>a ,c ,d ,e) {
printf("%i is the largest\n" ,b);}
if (c>a ,b ,d ,e){
printf("%i is the largest\n" ,c); }
if (d>a ,b ,c ,e) {
printf("%i is the largest\n" ,d);}
if (e>a ,b ,c ,d){
printf("%i is the largest\n" ,e);}
if (a
Still Need Help?
Join the QuestionCove community and study together with friends!
Sign Up
OpenStudy (anonymous):
if (c<a ,b ,d ,e) {
printf("%i is the smallest\n" ,c); }
if (d<a ,c ,b ,e) {
printf("%i is the smallest\n" ,d);}
if (e<c ,a ,b ,d) {
printf("%i is the smallest\n" ,e); }
return 0;
}
OpenStudy (anonymous):
this was the rest of the q..
OpenStudy (anonymous):
Is this C++?
OpenStudy (anonymous):
oh its python well I don't know python XD
OpenStudy (rbx):
This
```python
a >b ,c ,d ,e
```
isn't a valid boolean expression. You need to check if
```
a greater than b AND a greater than c AND a greater than d AND a greater than e
```
for which you need to type
```
a>b && a>c && a>d && a>e
```
Still Need Help?
Join the QuestionCove community and study together with friends!