Get Off-Campus Placement Jobs Info !!!
Programs asked in Mettl Coding Round
Click To Practce List of Programs asked in Nagarro !!!

Program Discussion :: Basics

Home > Programs > Basics

7 / 248

Write a program to print the nth fibonacci number.

Answer:

#include
#include
int main(int varc,char *varg[])
{
 int n=atoi(varg[1]);
 int n1=0,n2=1,n3,i,sum;
 if(a==1)
 printf("%d",0);
 if(a==2)
 printf("%d",1);
 if(a>2)
 {
  for(i=3;i

Asked In :: Cisco TCS Syntel Inc.

Post Your Answer Here:

Language:

Post Your Reply Here: