Re: C++ Coding Challenges
/*"Write a C function that multiplies an input integer by 5 and returns the result. The function must not use the multiplication operator. Optimize for speed."*/
#include<iostream.h>
#include<conio.h>
add(int);
int main()
{
clrscr();
int a;
cout<<"enter no:";
cin>>a;
add(a);
getch();
return 0;
}
int add(int a)
{
a=a+a+a+a+a;
cout<<a;
}
|