View Single Post
Old 09-28-2012, 11:21 PM   #10
CY5
Junior Member

Activity Longevity
0/20 6/20
Today Posts
0/11 ssssssss1
Default 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;
}
CY5 is offline