//WAP to print fibonacci series using do-while loop.?
using System;
class Fibonacci
{
public static void Main()
{
int a=1,b=1;
int sum=0;
Console.Write("Enter Limit:");
int n=Int32.Parse(Console.ReadLine());
Console.Write(a);
Console.Write(b);
do
{
sum=a+b;
a=b;
b=sum;
Console.Write(sum);
}
while(sum<n);
}
}
By-Vivek Kumar Keshari
What is the question?
If you have the series stored in an array, you loop through the array and print each array element in turn. Another possibility is to print out the numbers in the series as you generate them. In that case, you may not need to store anything (depending on the series, of course).
write a program to print the series 1/12+1/22+.........+1/n2 ?
string s = "asdfqwer"; s = s.ToUpper(System.Globalization.CultureInfo.CurrentCulture);
write a c program to display marks,total,average,grade using union
#include #include void main(void) { int i,j,k,n; clrscr(); i=0; j=1; printf("%d %d ",i,j); for(n=0;n<=5;n++) { k=i+j; i=j; j=k; printf("%d ",k); } getch(); }
write a c program to accept a number and generate a square root cube and exponential values
If you have the series stored in an array, you loop through the array and print each array element in turn. Another possibility is to print out the numbers in the series as you generate them. In that case, you may not need to store anything (depending on the series, of course).
write a program to print the series 1/12+1/22+.........+1/n2 ?
Please do.
Yes, I can.
string s = "asdfqwer"; s = s.ToUpper(System.Globalization.CultureInfo.CurrentCulture);
write a c program to display marks,total,average,grade using union
Exactly what do you mean by 'C program in Java'
#include #include void main(void) { int i,j,k,n; clrscr(); i=0; j=1; printf("%d %d ",i,j); for(n=0;n<=5;n++) { k=i+j; i=j; j=k; printf("%d ",k); } getch(); }
Without knowing the contents of the TippingBucketData.txt file nor how to process it, it would be impossible to say how such a program would be written.
Writing a program for a sum of sine series requires a rather long formula. That formula is: #include #include #include main() { int i,n,x; .
//to generate Fibonacci series upto a range of 200....(in C).... #include<stdio.h> main() { int a,b,c,i; a=0; b=1; printf("\n FIBONACCI SERIES .....\t"); i=1; while(i<=(200-2)) { c=a+b; printf("\t%d",c); a=b; b=c; i++; } }