#include
int main()
{
int rating;
printf("Enter your rating according to your experience\n");
scanf("$d", &rating);
switch (rating)
{
case '1': printf("Your rating is 1\n");
break;
case '2': printf("Your rating is 2\n");
break;
case '3': printf("Your rating is 3\n");
break;
case '4': printf("Your rating is 4\n");
break;
case '5': printf("Your rating is 5\n");
break;
default: printf("Your rating is invalid\n");
break;
}
return 0;
}
In this c program im trying to make a system for rating up to 5 from 1 but the result is only executes the default one
pls help me with this c program.
Answers
Answer:
E-Commerce refers to the performing online commercial activities, transactions over internet. E-Business refers to performing all type of business activities through internet. ... In e-commerce transactions are limited. In e-business transactions are not limited.
Explanation:
{
int rating;
printf("Enter your rating according to your experience\n");
scanf("$d", &rating);
switch (rating)
{
case '1': printf("Your rating is 1\n");
break;
case '2': printf("Your rating is 2\n");
break;
case '3': printf("Your rating is 3\n");
break;
case '4': printf("Your rating is 4\n");
break;
case '5': printf("Your rating is 5\n");
break;
default: printf("Your rating is invalid\n");
break;
}
return 0
{
int rating;
printf("Enter your rating according to your experience\n");
scanf("$d", &rating);
switch (rating)
{
case '1': printf("Your rating is 1\n");
break;
case '2': printf("Your rating is 2\n");
break;
case '3': printf("Your rating is 3\n");
break;
case '4': printf("Your rating is 4\n");
break;
case '5': printf("Your rating is 5\n");
break;
default: printf("Your rating is invalid\n");
break;
}
return 0
Answer:
#include <stdio.h>
int main()
{
int rating;
printf("Enter your rating according to your experience\n");
scanf("$d", &rating);
switch (rating)
{
case '1': printf("Your rating is 1\n");
break;
case '2': printf("Your rating is 2\n");
break;
case '3': printf("Your rating is 3\n");
break;
case '4': printf("Your rating is 4\n");
break;
case '5': printf("Your rating is 5\n");
break;
default: printf("Your rating is invalid\n");
break;
}
return 0;
}