Click here to Skip to main content
15,890,123 members
Please Sign up or sign in to vote.
1.05/5 (4 votes)
See more:
I have problem in understanding the program statement

statement


write a program that multiples 2 up to 50


I understand above statement that program of table of 2 up to 50

is I write or wrong?
Posted
Comments
Maximilien 15-Dec-13 9:24am    
you'd better ask the person who wrote that "statement"
CPallini 15-Dec-13 13:06pm    
I suppose you are right.
Atul Khanduri 15-Dec-13 16:02pm    
Yes, u are right.....

I'd say you are right: it wants you to provide a program that outputs:
 1 * 2 =  2
 2 * 2 =  4
...
24 * 2 = 48
25 * 2 = 50
 
Share this answer
 
you have to multiply 2*2 upto 50 times
step 0 : declare a temp variable and temp=1;
step 1 : run step 2 for 50 times
step 2 : temp = temp * 2;
C++
#include<stdio.h>
void main()
{
 int temp=1,i;
 for(i=1;i<=50;i++)
 {
  printf("%d",(temp*2));
 }
}
 
Share this answer
 
v4

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900