answersLogoWhite

0


Best Answer

main(){

int temp,prev,i;

for(i=2,prev=1;prev<=256;i++){

printf("%d ",prev);

temp=i;

i=i*prev;

prev=temp;

}

}

User Avatar

Wiki User

15y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

15y ago

hi here is the program for u //program to print the series 1,-4,7,-10,13,-16 etc...

#include<stdio.h>

#include<math.h>

void main()

{

int i,n,sign=1;

printf("Enter the number of terms to which u want to print the series\n");

scanf("%d",&n);

for(i=1;i<=(1+(n-1)*3);i=i+3)

{

sign=pow((-1),(i+1));

printf("%d\t",(sign*i));

}

} here the sign is changing for every even term so we can use (-1)^(i+1), so when i=even then power of -1 will be odd...hence it will be -1.now in the for loop part in the middle section i have put an A.P. formula for number of terms, in arithmatic progression tn=a+(n-1)*d where tn=nth term, a=first term d= the difference of the series if u still have any confusions plz feel free to buzz me...thru mail adishredder@Yahoo.co.in

This answer is:
User Avatar

User Avatar

Wiki User

15y ago

...

char ch;

int number = 0;

do

{

cout << number << " ";

number++;

} while (ch != s);

//When you press 's' the loop will quit.

...

This answer is:
User Avatar

User Avatar

Wiki User

14y ago

// Here are three ways to answer your question. Hope it's not a homework assignment! // -----Method 1------ // #include int main() { printf("1121231234"); return 0; } // -----Method 2------ // #include int main() { int i, j; for(i=1; i

This answer is:
User Avatar

User Avatar

Wiki User

13y ago

#include <stdio.h>

int main (void) { puts ("1 12 123 1234 12345"); return 0; }

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How to write a program to print 1 2 3... series in C?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Write a C program to print the following series 112 122 . 1n2?

write a program to print the series 1/12+1/22+.........+1/n2 ?


Write a java script program to print first ten odd natural numbers in C?

Q.1 Write a program to print first ten odd natural numbers. Q.2 Write a program to input a number. Print their table. Q.3 Write a function to print a factorial value.


Write a c program to print the 100 to 1 nos?

Write a c program to print the 100 to 1 nos


Program for print prime all number from 1 to 100 in foxpro?

Prime numbers are numbers that are only divisible by themselves and the number 1. You can write a program to print all prime numbers from 1 to 100 in FoxPro.


How do you write multiplication table program in php?

// example of 1..12x12 table for($i = 1; $i &lt;= 12; $i++) { for($j = 1; $j &lt;= 12; $j++) { print ($i * $j) ." "; } print "\n"; }


Write a c program to print the following pyramid 1 121 1231 12321 1234321?

123454321


Write a qbasic program to accept a no and print it multiple table?

Cls print the multiples tables of 1 to 5 for x=1 to 5 for y=1 to 10 print x;"*";y;"=";x*y next y print print next x end


Write a program to print following series 100 81 64 49 36 25 16 9 4 1 by using for loop .?

10 rem for next 20 for i=10 to 1 step -1 30 ? I^2; 40 next i 50 end


Write a program to Print pyramid of numbers using java?

hi question is here, 1 1 2 1 2 3 1 2 3 4


Write a program to print following series 1 01 010 1010 .?

Program to print one & zero Alternatively#include#includevoid main(){int i,j,n,k=1;clrscr();printf("Enter the Iteration Value : ");scanf("%d",&n);for(i=1;i


Write a program in C to print 1 to10 as 1 2 3 4 5 6?

int main() { for(int i = 1; i


How do you write a c program to print the pattern 1 1 0 1 1 0 1 1 0 1?

for (int i=0; i&lt;3; ++i) printf ("1 1 0 "); printf("1\n");