Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,173,948 members, 7,890,118 topics. Date: Monday, 15 July 2024 at 09:33 AM |
Nairaland Forum / Science/Technology / Programming / C Programming Help Needed (717 Views)
C Programming Help / [Programming Help] Html Experts Urgently Needed (2) (3) (4)
(1) (Reply)
C Programming Help Needed by cruworld(m): 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 |
(1) (Reply)
Can Anyone Teach C#,asp.net / Greatest Expo Of The Year / How Can I Control Spammers In A Forum
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 6 |