Answered Questions

  • Header File

    Why should we use header file?

    rkanna

    • Dec 22nd, 2008

    for example...we should include the header file (Ex: #include<stdio.h>) before the main function. because if we are going to use following function in our program we should  inclu...

  • C Armstrong Number and multiple coding questions

    Q1. write a program to find a given number is armstrong number or not ?Q2write a program which accepts a filename as a command line argument and reverse the contents of the file(i.e first character becomes the last character of the file and so on ?Q3 how can i call a function given its name as a string ?Q4 How to swap low-order byte and high order byte in an integer without using temporary variable?Q5...

    khadar.ali

    • Sep 7th, 2011

    A program to accept a number and find how many digits it contain

    //
    declare
    a number:=&a;
    v_le number;
    begin
    select length (a) into v_le from dual;
    dbms_output.put_line('the no of digits is '||v_le);
    end;
    //

    Trinesh Baliga

    • Jul 19th, 2011

    This Program will Print the Armstrong Numbers between 1 to 500 "c# class Program { static void Main(string[] args) { int[] number=new...

  • Write a program to implement the Fibonacci series

    Star Read Best Answer

    Editorial / Best Answer

    baseersd  

    • Member Since Jun-2007 | Jul 27th, 2007


    Code
    1.  
    2. #include
    3. int main()
    4. {
    5. unsigned int i = 0, j = 0, sum = 1, num;
    6. printf("nEnter the limit for the series ");
    7. scanf("%d", &num);
    8. while (sum < num) {
    9. printf("%d ", sum);
    10. i = j;
    11. j = sum;
    12. sum = i + j;
    13. }
    14. getch();
    15. }
    16.  

    keerthi

    • Jun 7th, 2013

    Code for fibonacci series

    Code
    1. #include<stdio.h>
    2. void main(){
    3. int i=0,j=1,sum=0,num;
    4. printf("enter the size of the series");
    5. scanf("%d",&num);
    6. while(sum<num){
    7. printf("%d",sum);
    8. i=j;
    9. j=sum;
    10. sum=i+j;
    11. }
    12. getch();
    13. }
    14.  

    n.m.sudesh kumar

    • Mar 20th, 2013

    Code
    1. #include<stdio.h>
    2. #include<conio.h>
    3. void main()
    4. {
    5. int pre=0,next=1,sum=0,n;
    6. clrscr();
    7. printf("enter the value of n:");
    8. scanf("%d",&n);
    9. while(pre<=n)
    10. {
    11. printf("the fibonacci series; %d
    12. ",pre);
    13. sum=pre+next;
    14. pre=next;
    15. next=sum;
    16. }
    17. getch();
    18. }