C Program to find sum of two numbers
C Program to find sum of two numbers#include<stdio.h>int main(){ int a, b, sum; printf("\nEnter two no: "); scanf("%d %d", &a, &b); sum = a + b; printf("Sum : %d", sum); r...
// To print fibonacci series
#include <stdio.h>
int main()
{
int a, b, c, n;
a=0;
b=1;
c=0;
printf("Enter a positive number: ");
scanf("%d", &n);
printf("Fibonacci Series: %d, %d, ", a, b);
c = a + b;
while (c <= n)
{
printf("%d, ", c);
a = b;
b = c;
c = a + b;
}
return 0;
}
If you don't understand any step ( even the simplest one ) or the program fails to run, feel free to e-mail me.
Keep Exploring. ; )