Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1) Define ternary operator. Write a C program to find the maximum of two numbers using ternary operators. 2) You want to build a fibonacci

1) Define ternary operator. Write a C program to find the maximum of two numbers using ternary operators.

2)

You want to build a fibonacci series up to n terms. Now solve these problems without using an array and at first write the steps to solve these problems and then write a C program for it.

Note - The Fibonacci sequence is a sequence where the next term is the sum of the previous two terms. The first two terms of the Fibonacci sequence are 0 followed by 1.

Input Format:

You are given a positive integer n.

Output Format:

Print the fibonacci series up to n terms.

See the sample input output for more clarification

Sample input

Sample output

10

0, 1, 1, 2, 3, 5, 8, 13, 21, 34

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Datacasting How To Stream Databases Over The Internet

Authors: Jessica Keyes

1st Edition

007034678X, 978-0070346789

More Books

Students also viewed these Databases questions