Technical Questions

Q:

Write a program to generate the Fibonacci series in c?

Answer

 #include<stdio.h>
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<r;k++){
         f=i+j;
         i=j;
         j=f;
         printf(" %ld",j);
    }
 
    return 0;
}

Sample output:
Enter the number range: 15
FIBONACCI SERIES: 0 1 1 2 3 5 8 13 21 34 55 89 144 233 377

Report Error

View answer Workspace Report Error Discuss

Subject: Programming

0 2102
Q:

What is Stack?

Answer

stack is portion of RAM used for saving the content of Program Counter and general purpose registers.


LIFO stacks, also known as "push down" stacks, are the conceptually simplest way of saving information in a temporary storage location for such common computer operations as mathematical expression evaluation and recursive subroutine calling.

Report Error

View answer Workspace Report Error Discuss

Subject: Hardware

0 2092
Q:

What is CPU Scheduler?

Answer

Selects from among the processes in memory that are ready to execute, and allocates the CPU to one of them. CPU scheduling decisions may take place when a process: 1.Switches from running to waiting state. 2.Switches from running to ready state. 3.Switches from waiting to ready. 4.Terminates. Scheduling under 1 and 4 is non-preemptive. All other scheduling is preemptive.

Report Error

View answer Workspace Report Error Discuss

2 2091
Q:

What is Executive in Windows NT?

Answer

In Windows NT, executive refers to the operating system code that runs in kernel mode.

Report Error

View answer Workspace Report Error Discuss

1 2091
Q:

What would be the output of the following program?

main()

{

  extern int i;

   i = 20;

  printf( "%d", sizeof(i) );

}

Answer

extern int i is a declaration and not a definition, hence Error occured.

Report Error

View answer Workspace Report Error Discuss

Subject: Programming

0 2088
Q:

Write a program for matrix multiplication in c

Answer

#include <stdio.h>


int main() {


  int a[5][5], b[5][5], c[5][5], i, j, k, sum = 0, m, n, o, p;


  printf( "\nEnter the row and column of first matrix" );


  scanf( "%d %d", &m, &n );


  printf( "\nEnter the row and column of second matrix" );


  scanf( "%d %d", &o, &p );


  if(n!=o) {


      printf( "Matrix mutiplication is not possible" );


      printf( "\nColumn of first matrix must be same as row of second matrix" );


  }


  else {


      printf( "\nEnter the First matrix" );


      for( i=0; i<m; i++ )


      for( j=0; j<n; j++ )


           scanf( "%d", &a[i][j] );


      printf( "\nEnter the Second matrix" );


      for( i=0; i<o; i++ )


      for( j=0; j<p; j++ )


           scanf( "%d", &b[i][j] );


      printf( "\nThe First matrix is\n" );


      for( i=0; i<m; i++ ) {


      printf("\n");


      for( j=0; j<n; j++ ) {


           printf( "%d\t", a[i][j] );


      }


      }


      printf( "\nThe Second matrix is\n" );


      for( i=0; i<o; i++ ) {


      printf("\n");


      for( j=0; j<p; j++ ) {


           printf( "%d\t", b[i][j] );


      }       


      }


      for( i=0; i<m; i++ )


      for( j=0; j<p;j++ )


           c[i][j] = 0;


      for( i=0; i<m; i++ ) { //row of first matrix


      for( j=0; j<p; j++ )  {  //column of second matrix


           sum = 0;


           for( k=0; k<n; k++ )


               sum = sum + a[i][k]*b[k][j];


           c[i][j] = sum;


      }


      }


  }


  printf( "\nThe multiplication of two matrix is\n" );


  for( i=0; i<m; i++ ) {


      printf("\n");


      for( j=0; j<p; j++ ) {


           printf( "%d\t", c[i][j] );


      }


  }


  return 0;


}

Report Error

View answer Workspace Report Error Discuss

Subject: Programming

0 2085
Q:

Benefits of Software Quality Assurance to the organization

Answer

The main task of Software Quality Assurance Group is to examine the overall s/w development process and to create and enforce standards and methods to improve it with the goal of preventing bugs from ever occurring. With this definition, it is imperative that the QA helps an organization in continuous performance improvement and strive for perfection.

Report Error

View answer Workspace Report Error Discuss

Subject: Software Testing

0 2085
Q:

Point out the error, ifany, in the followingb code?

typedef struct

{

     int data;

     NODEPTR link;

} *NODEPTR;

 

Answer

A typedef defines a new name for a type, and in simpler cases like the one shown below you can define a new structure type and a typedef for it at the same time.


typedef struct


{


    char name[20];


    int age;


} emp;


However, in the structure defined in this question, there is an error because a typedef declaration cannot be used until it is defined. In the given code fragment the typedef declaration is not yet defined at he point where the link field is declared.

Report Error

View answer Workspace Report Error Discuss

Subject: Programming

0 2084