₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,325,293 members, 8,421,208 topics. Date: Saturday, 06 June 2026 at 12:11 AM

Toggle theme

C Programming Help Needed - Programming - Nairaland

Nairaland ForumScience/TechnologyProgrammingC Programming Help Needed (769 Views)

1 Reply

C Programming Help Needed by cruworld(op): 7:19pm On Dec 17, 2009
/* Demonstrates the use of if statements */

#include <stdio.h>

int main( void )
{
   
 int x, y;
/* Input the two values to be tested */

printf("\nInput an integer value for x: "wink;
scanf("%d",&x);
fflush(stdin);


printf("\nInput an integer value for y:"wink;
scanf("%d", &y);
fflush(stdin);

/* Test values and print result */
switch( x,y )
{
case 1: x == y ;
printf("x equal y\n"wink;

case 2:x > y;
printf("x is greater than y\n"wink;
break;
case 3: x < y;
printf("x is smaller than y\n"wink;
break;

break;
}

getchar();
return 0;
}


Why is my program not returnin output for case 1: x == y ;
printf("x equal y\n"wink; huh?
Re: C Programming Help Needed by Cockyzy(m): 8:17pm On Dec 17, 2009
Guy,try put break after your 1st case statement and also create the default case too.Use IF If u can get it done
1 Reply

C Programming Help[Programming Help] Html Experts Urgently Needed234

I Want To Be A Pro- Web Designer, Which Languages Should I Learn?Help On Linux Based Command LinePls Help...