what is the code of the output of print the 10 fibonacci
number series
Answers were Sorted based on User's Feedback
Answer / arun asokan
#include<stdio.h>
#include<conio.h>
void main()
{
int a=0,b=1,c,limit=8;
clrscr();
printf("%d\t%d",a,b);
for(n=1;n<=limit;n++)
{
c=a+b;
a=b;
b=c;
printf("\t%d",c);
}
getch();
}
Is This Answer Correct ? | 4 Yes | 0 No |
Answer / prassatharun
#include<stdio.h>
void main()
{
int a=0,b=1,c,limit=10,n=1;
clrscr();
printf("%d\n%d",a,b);
while(n<=limit)
{
c=a+b;
a=b;
b=c;
printf("\n%d",c);
n++;
}
getch();
}
Is This Answer Correct ? | 0 Yes | 2 No |
Sorting entire link list using selection sort and insertion sort and calculating their time complexity
1 Answers Infosys, Microsoft, NetApp,
void main() { if(~0 == (unsigned int)-1) printf(“You can answer this if you know how values are represented in memory”); }
String reverse with time complexity of n/2 with out using temporary variable.
Write a program to check whether the number is prime and also check if it there i n fibonacci series, then return true otherwise return false
main() { struct date; struct student { char name[30]; struct date dob; }stud; struct date { int day,month,year; }; scanf("%s%d%d%d", stud.rollno, &student.dob.day, &student.dob.month, &student.dob.year); }
Write a Program that Inputs 10 Numbers in an Array and Show the Maximum Number
abcdedcba abc cba ab ba a a
void main() { int k=ret(sizeof(float)); printf("\n here value is %d",++k); } int ret(int ret) { ret += 2.5; return(ret); }
how can i search an element in an array
2 Answers CTS, Microsoft, ViPrak,
main() { int a[10]; printf("%d",*a+1-*a+3); }
main() { char str1[] = {‘s’,’o’,’m’,’e’}; char str2[] = {‘s’,’o’,’m’,’e’,’\0’}; while (strcmp(str1,str2)) printf(“Strings are not equal\n”); }
How to use power function under linux environment.eg : for(i=1;i<=n;i++){ pow(-1,i-1)} since it alerts undefined reference to 'pow'.