שפת c
Question:

כתוב תוכנה שקולטת 4 מספרים ומדפסה אותם בערך שלם מגדול לקטן

Provide an answer by clicking on "Map" and then on "Add an Answer".



Results, Analysis and Discussion


Comments:
1.  shalata mohammed (24.11.2016 am 01.27.33)
mohammed shalats

#include<stdio.h>

void main ()

{

       int x,y,z,t;

       int a=0,b=0,c=0,d=0;

       int sec=0,last=0;

 

       scanf("%d %d %d %d",&x, &y, &z, &t);

 

       if(x>y&&x>z&&x>t){

              printf("%d ",x);

              a=x;

              b=y;

              c=z;

              d=t;

       }

       if(y>x&&y>z&&y>t){

              printf("%d ",y);

              a=y;

              b=a;

              c=z;

              d=t;

       }

       if(z>x&&z>y&&x>t){

              printf("%d ",z);

              a=z;

              b=y;

              c=x;

              d=t;

       }

       if(t>x&&t>y&&t>z){

              printf("%d ",t);

              a=t;

              b=x;

              c=y;

              d=z;

       }

 

       if(b>d&&b>c)

       {

              printf("%d ",b);

              sec=c;

              last=d;

       }

       if(d>b&&d>c)

       {

              printf("%d ",d);

              sec=b;

              last=d;

       }

       if(c>b&&c>d)

       {

              printf("%d ",c);

              sec=d;

              last=b;

       }

 

       if(sec>last)

       {

              printf("%d ",sec);

              printf("%d ",last);

       }

       if(last > sec)

       {

              printf("%d ",last);

              printf("%d ",sec);

       }

 

}



History of edits
Edited BY: ahmad abbas Edit Date: 2016-11-20 11:32:04
Created By: ahmad abbas Edit Date: 2016-11-17 11:47:38
More Interactive Questions that might interest you In Other