logo

CuriousTab

CuriousTab

Discussion


Home Technical Questions Programming Comments

  • Question
  • Write a program to generate the Fibonacci series in c?


  • Correct Answer
  • #include int main(){ int k,r; long int i=0l,j=1,f; //Taking maximum numbers form user printf("Enter the number range:"); scanf("%d",&r); printf("FIBONACCI SERIES: "); printf("%ld %ld",i,j); //printing firts two values for(k=2;k


  • Programming problems


    Search Results


    • 1. Swap two variables without using third variable.
    • Discuss
    • 2. Why we use do-while loop in c?
    • Discuss
    • 3. Write a c program to create dos command type.
    • Discuss
    • 4. What will be output when you will execute following c code? #include enum actor { SeanPenn=5, AlPacino=-2, GaryOldman, EdNorton }; void main() { enum actor a=0; switch(a) { case SeanPenn: printf("Kevin Spacey"); break; case AlPacino: printf("Paul Giamatti"); break; case GaryOldman:printf("Donald Shuterland"); break; case EdNorton: printf("Johnny Depp"); } }

    • Options
    • A. Kevin Spacey
    • B. Paul Giamatti
    • C. Donald Shuterland
    • D. Johnny Depp
    • Discuss
    • 5. What will be output of following c code? void main() { struct bitfield { unsigned a:5; unsigned c:5; unsigned b:6; }bit; char *p; struct bitfield *ptr,bit1={1,3,3}; p=&bit1; p++; clrscr(); printf("%d",*p); getch(); }
    • Discuss
    • 6. C program to find the factorial of a given number
    • Discuss
    • 7. Write a c program to check whether a number is strong or not.
    • Discuss
    • 8. Write a c program to print multiplication table
    • Discuss
    • 9. Write a c program for selection sort.
    • Discuss
    • 10. Write a c program for quick sort.
    • Discuss


    Comments

    There are no comments.

Enter a new Comment