Language – Java | Type – Problem (Code) | Last date 29-Mar-2009 | 12:00 p.m. IST | Points 5
Here I was quietly doing my work (Ok ok I was playing mind sweeper) when my manager comes to me and ask me to write a code that could multiple two floating point numbers for him. Why he does not use a calculator, I cannot imagine, but I started to write the program anyway.
As you know my key board gives me a lot of trouble and the ‘*’ sign does not work. Help me out folks!
Write a program to multiple two floating point numbers.
Twist: Do not use the “*” (multiplication sign) in the entire program.
Got an answer? Why don’t you leave it here.
int x,y,i,ans=0;
ReplyDeleteclrscr();
printf("Enter any 2 nos");
scanf("%d%d",&x,&y);
for(i=1;i<=y;i++)
{
ans+=x;
}
printf("Answer is %d",ans);