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?

Answers were Sorted based on User's Feedback



int main() { int days; printf("enter days you are late"); scanf("%d",days..

Answer / 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

int main() { int days; printf("enter days you are late"); scanf("%d",days..

Answer / sandeep

Guys '&' is missing in the scanf statement

Is This Answer Correct ?    2 Yes 1 No

Post New Answer

More C Interview Questions

the operator for exponencation is a.** b.^ c.% d.not available

5 Answers   TCS,


program that accepts amount in figures and print that in words

2 Answers   Infosys, Lovely Professional University, Wipro,


What is the difference between malloc() and calloc() function in c language?

0 Answers  


write an algorithm and c program to add two 2x2 matrics

2 Answers  


Explain what standard functions are available to manipulate strings?

0 Answers  






being a chemical engineer and with an aggregate of 80% why you opt for TCS and not your core industry?

1 Answers   TCS,


Write a C program to help a HiFi’s Restaurant automate its breakfast billing system. Your assignment should implement the following items: a. Show the customer the different breakfast items offered by the HiFi’s Restaurant. b. Allow the customer to select more than one item from the menu. c. Calculate and print the bill to the customer. d. Produce a report to present your complete program and show more sample output. Assume that the HiFi’s Restaurant offers the following breakfast menu: Plain Egg $2.50 Bacon and Egg $3.45 Muffin $2.20 French Toast $2.95 Fruit Basket $3.45 Cereal $0.70 Coffee $1.50 Tea $1.80

0 Answers  


What is the basic structure of c?

0 Answers  


Define circular linked list.

0 Answers  


Can a file other than a .h file be included with #include?

0 Answers   Aspire, Infogain,


What is the difference between printf and scanf in c?

0 Answers  


#define FALSE -1 #define TRUE 1 #define NULL 0 main() { if(NULL) puts("NULL"); else if(FALSE) puts("TRUE"); else puts("FALSE"); }

1 Answers  


Categories