#include<iostream.h>
#include<conio.h>
#include<conio.h>
void main()
{
clrscr();
int i;
for(i=1;i<=128;i*=2)
cout<<i<<” “;
getch();
}
void main()
{
clrscr();
int i;
for(i=1;i<=128;i*=2)
cout<<i<<” “;
getch();
}
how can i print this series -1 2 -4 8 -16 32 -64 128………..
@pankaj you can print this series by multiplying i by -1 each time like this…….
for(i=i;i<=128;++i)
i*=(-1);
just try it you will definitely get your result……..
we will get negative ans each time that is wrong answer
How can i print this series:
1
1 2
1 2 3
1 2 3 4
for($i=1; $i<=4; $i++ ){
for($j=1; $i<=$i; $j++){
echo $i;
}
echo "
"
}
int main()
{
int n;
cin>>n;
for(int i=1;i<=n;i++){
for(int j=1;j<=i;i++){
}
cout<<i;
}
}
@Rajendra
for(int i=1;i<5;++i)
{
for(int j=1;j<i;j++)
cout<<j;
cout<<"n";
}
how can i copy one file content into another using command line arguments ??
@phanikumar sorry i have no idea about it………….
@neeraj
its ok
how can i print tis series 1,2,4,8,16,32,64,128……………n using function
@mansi
void sum(int n)
{
for(int i=1;i<=n;i*=2)
cout<<i<<" ";
}
just call this function from void main()………
I WANT THE EXPLANATION FOR THE PROGRAM TO PRINT
1
12
123
1234
I want code of following series 64 32 16 8 4 2
#include
using namespace std;
int main()
{
int i;
for(i=64;i>=2;i/=2)
cout<<i<<" ";
return 0;
}
Hlp me in printing factoria of all numbes upto 100 at same time
How can i print this series with using for loop
-4,-2,0,2,4
Write a program that takes an integer as an input from user and prints if it is a prime or composite number.Also ask to run again program or not (Do-While) plz solve this programmm
how i can print this series 0,1,2,6,16,….
How can I print the series…. 1,2,2,4,8,32…
how can i make a program like 2 4 6 8 10 ………N using if statements.Pls solve my code.I think my code is ok.but when i run this program .the console just show me 2.pls solve it.
#include
int main()
{
int j,product;
j=2;
product=1;
if(j<=10)
{
product=product*j;
printf("%d\n",product);
j+=2;
}
}
You can’t to do this using only if, you have to use loops also. Just follow above program.
#include
Using namespace std;
Int main()
{
Int j;
For(int i=1;I<=10;I++)
{
J=i+I;
Cout<<j<<endl;
}
return 0;
}
1 3 4 8 16 32 how can i get this
help me pls
Hello!
how to print this series in c++
8 5 3 2 1
5 3 2 1
3 2 1
2 1
1
2 4 8 16 32 output
In php require
can u please convert code in to c program.
how i can print sum of (1)2 + (2)2 + (3)2 + (4)2+(5)2 using go to statement
2,2,4,8,32,256,2041 can any one print this pattern
How to print series
4 32 128 256 in C#
Write a program which prints sum of the following series 4+16+36+64+…..+400.
Write a program to print 1,2,4,8,16,32,64 using goto statement
Write a C program to generate the following series 7, 5, 8, 6, 9….
1 2
1 2 4
1 2 4 8
1 2 4 8 16
1 2 4 8 16 32
1 2 4 8 16 32 64
1 2 4 8 16 32 64 128
1 2 4 8 16 32 64 128 256
1 2 4 8 16 32 64 128 256 512
1 2 4 8 16 32 64 128 256 512 1024
Write a program that display the sum of the following series?
1,2,4,8,16,32,64