int main()
{
int days;
printf("enter days you are late");
scanf("%d",days);
if (days<=5)
printf("5o paisa fine");
if (days<=10&&days>=6)
printf("1rs fine");
if(days>10)
printf("10 rs fine");
if(days=30)
printf("membership cancelled");
return 0;
}
tell me whats wrong in this program? is it right?
Answer Posted / hajera
1. & is missing in scanf and
2. if(days=30) one more equal is missing
instead of if(days == 30)
printf("membership cancelled")
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
Difference between macros and inline functions? Can a function be forced as inline?
the factorial of non-negative integer n is written n! and is defined as follows: n!=n*(n-1)*(n-2)........1(for values of n greater than or equal to 1 and n!=1(for n=0) Perform the following 1.write a c program that reads a non-negative integer and computes and prints its factorial. 2. write a C program that estimates the value of the mathematical constant e by using the formula: e=1+1/!+1/2!+1/3!+.... 3. write a c program the computes the value ex by using the formula ex=1+x/1!+xsquare/2!+xcube/3!+....
How can I find out if there are characters available for reading?
What is the general form of a C program?
What is the difference between typedef struct and struct?
Should I learn c before c++?
Explain what is the difference between a string and an array?
What is the purpose of main() function?
write a program to find out prime number using sieve case?
What are the two types of structure?
why arguments can generally be passed to functions a) sending the values of the arguments b) sending the addresses of the arguments c) a & b d) none of the above
Write a program to reverse a linked list in c.
What is FIFO?
write a program that will open the file, count the number of occurences of each word in the the complete works of shakespeare. You will then tabulate this information in another file.
Is multithreading possible in c?