C Programming Help Needed - Programming - Nairaland
Nairaland Forum › Science/Technology › Programming › C 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: " ;scanf("%d",&x); fflush(stdin); printf("\nInput an integer value for y:" ;scanf("%d", &y); fflush(stdin); /* Test values and print result */ switch( x,y ) { case 1: x == y ; printf("x equal y\n" ;case 2:x > y; printf("x is greater than y\n" ;break; case 3: x < y; printf("x is smaller than y\n" ;break; break; } getchar(); return 0; } Why is my program not returnin output for case 1: x == y ; printf("x equal y\n" ; ? |
| 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 |
C Programming Help • [Programming Help] Html Experts Urgently Needed • 2 • 3 • 4
I Want To Be A Pro- Web Designer, Which Languages Should I Learn? • Help On Linux Based Command Line • Pls Help...
;
?