Sunday, July 12, 2009

Are you a programmer ?? Can you help me to explain this Program in C-language? (below)?

Program in C using one-dimensional array that determines the lowest value among five input values from the keyboard and prints the difference of each value from the lowest.





INPUT: 28643


OUTPUT:


5


4


2


1





#include %26lt;stdio.h%26gt;


main()


{


int inp[5],i,min;





printf("Enter 5 values--%26gt;");





for (i=0; i%26lt;5;i++)


{


scanf("%d", %26amp;inp[i]);


}





min=inp[0];


for (i=1; i%26lt;5; i++)


{


if (inp[i] %26lt; min)


min=inp[i];


}


printf("Minimm=%d\n",min);





for(i=0; i%26lt;5;i++)


{


printf("%d\n", inp[i]-min);


}





}

Are you a programmer ?? Can you help me to explain this Program in C-language? (below)?
I'm not sure what you're asking. The description at the beginning says exactly what it does. Or are you asking for line-by-line explanation?


No comments:

Post a Comment