You are on page 1of 1

/* Problem Statement: Enter 2 numbers and print them out.

Then print the next 10 numbers in the sequence, where the

next number is the sum of the previous two.*/

#include <stdio.h>

int main(){

int i, num1,num2, sum=0;

printf("Enter the first number: ");

scanf("%d", &num1);

printf("Enter the second number: ");

scanf("%d", &num2);

printf("%d %d ", num1, num2);

for(i=0;i<10;i++){

sum = num1 + num2;

printf("%d ", sum);

num1 = num2;

num2 = sum;

return 0;

You might also like