Question: 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
Get step-by-step solutions from verified subject matter experts
