118,275 views
6 votes
6 votes
Can anyone help me please​

Can anyone help me please​-example-1
User Margot
by
2.3k points

1 Answer

20 votes
20 votes

Answer:

See images below for code

Note the warning I have provided about program (c)

Explanation:

Note that I have given complete programs. But you are asked to only write the C segments corresponding to that problem.

In the third program, I have used the syntax

case 100 ... 102:
printf("Paid\\");
break;

This means that if the number lies in the range 100 -102 the corresponding statement will execute.

However, this is not recognized by all C compilers!

You can explain to the professor that you found this on the internet (stackoverflow.com is a great site for programing resources)

Otherwise you will have to split up that into 3 separate case statements as follows:

switch(inv)
{
case 100:
printf("Paid\\");
break;

case 101:
printf("Paid\\");
break;

case 102:
printf("Paid\\");
break;

Hope that helps you out


Can anyone help me please​-example-1
Can anyone help me please​-example-2
Can anyone help me please​-example-3
User Dbaxime
by
2.9k points