Introduction

The main purpose of this blog is to share our experience with the world and get experience from the world. This will be a new venture for us and we are sure, we shall learn a lot with it. we will try to Explore our mind which will be very helpful for all us. As from its name, its a blog covering all the topics. we will try to post all the interesting topics and give our opinion. Do give your point of view in comments.


"NAVIGATE VIA BLOG ARCHIVE ON RIGHT TO GET WHAT YOU ARE LOOKING FOR"


Wednesday, January 26, 2011

C CODE FOR GREATEST SUM

#include<stdio.h>
int main() {


int x,y,z;


printf("PLEASE ENTER THE NUMBERS\n");


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

if ( (x+y>x+z)  &&  (x+y>y+z)   )

{ printf("THE SUM ie %d OF %d AND %d IS GREATEST\n",x+y,x,y); }

if ( (y+z>x+y)  &&   (y+z>x+z)  )

{ printf("THE  SUM ie %d OF %d AND %d IS GREATEST\n",y+z,y,z); }

if( (z+x>x+y )  &&    (z+x>y+z) )

{ printf("THE SUM IS %d OF %d AND %d IS GREATEST\n",z+x,z,x); }

return 0;
}

No comments:

Post a Comment

Related Posts with Thumbnails