# If I send number 1 to 10 it need to multiply with 2, if I send number 11 to 20 it need to multiply with 36

closed Sep 22, 2021

If I send a number it need to multiply.
Example: If I send number 1 to 10 it need to multiply with 2

If I send number 11 to 20 it need to multiply with 36

My code.  (The "amount" is the value enterring  and the enter number is the one is multiplying.

#include<stdio.h>
#include<conio.h>

main(){
int a, b, c;
printf("\tTITLE");
printf("\nEnter amount: ");
scanf("%d", &a);
printf("Enter Number: ");
scanf("%d", &b);
c = a*b;
printf("Ans: %d", c);
printf("\nThank you for using!!!");
}

closed with the note: I got answer for this question by helping hearts..

+1 vote
answered Sep 22, 2021 by (540 points)
selected Sep 22, 2021 by TN CODER

#include<stdio.h>
#include<stdio.h>
void main()
{
int a,mul;
printf("Enter the numbers");
scanf("%d",&a);
if( (a>=1)&&(a<=10))
{
mul=a*2;
printf("a is multiplied by 2=%d",mul);
}
else if((a>=11)&&(a<=20))
{
mul=a*36;
printf("a is multiplied by 36=%d",mul);
}
else
printf("the entered number is not valid");
}
commented Sep 22, 2021 by (280 points)
Thank you bro foe helping me by giving code's. :)
+1 vote
answered Sep 20, 2021 by (88,130 points)

You need to use the if statement.

Please, check out online how to use it. You can fine one of the many tutorials here.