I get error msg non-lvalue in assignment(mark with red color)
help me. Thanks.Code:// Write a program that asks the user for a 24-hour time,// Then displays the time in 12-hour form: // CREATED BY: ABHIJIT DAS // DATE: 28.6.2012 #include<stdio.h> #include<conio.h> main() { int hour, min, hour_12; printf("Enter a 24-hour time(as xx:xx):\n"); scanf("%d:%d", &hour, &min); hour_12 = hour - 12; if( 0 = hour_12 && 0 = min) { printf("The time is 12:00 AM"); } else if(hour <= 24) { printf("Equivalent 12-hour time: %d:%d", hour_12, min); } else printf("Invaled time"); if(hour = 0) { printf("You enter an invaled time"); } else if(hour > 0 && hour <= 12) { printf("AM"); } else if(hour > 12 && hour <= 24) { printf("PM"); } else printf("You enter an invaled time"); getch(); return 0; }![]()



LinkBack URL
About LinkBacks



