Technical Questions

Q:

Write a c program for linear search.

Answer

#include<stdio.h>
int main(){

    int a[10],i,n,m,c=0;

    printf("Enter the size of an array: ");
    scanf("%d",&n);

    printf("Enter the elements of the array: ");
    for(i=0;i<=n-1;i++){
         scanf("%d",&a[i]);
    }

    printf("Enter the number to be search: ");
    scanf("%d",&m);
    for(i=0;i<=n-1;i++){
         if(a[i]==m){
             c=1;
             break;
         }
    }
    if(c==0)
         printf("The number is not in the list");
    else
         printf("The number is found");

    return 0;
}

Sample output:
Enter the size of an array: 5
Enter the elements of the array: 4 6 8 0 3
Enter the number to be search: 0
The number is found

Report Error

View answer Workspace Report Error Discuss

Subject: Programming

2 6863
Q:

Explain fork() system call?

Answer

The `fork()’ used to create a new process from an existing process. The new process is called the child process, and the existing process is called the parent. We can tell which is which by checking the return value from `fork()’. The parent gets the child’s pid returned to him, but the child gets 0 returned to him.

Report Error

View answer Workspace Report Error Discuss

Subject: Operating Systems Exam Prep: GATE

2 6689
Q:

A computer assisted method for the recording and analyzing of existing or hypothetical systems is

A) Data transmission B) Data capture
C) Data flow D) Data processing
 
Answer & Explanation Answer: C) Data flow

Explanation:
Report Error

View Answer Report Error Discuss

7 6629
Q:

 When assessing the table structure of an acquired set of tables with data, accessing the validity of possible referential integrity constraints on foreign keys is (part of) the:

A) first step. B) second step.
C) third step. D) fourth step.
 
Answer & Explanation Answer: C) third step.

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Database

2 6540
Q:

What do the functions atoi(), itoa() and gcvt () do? Show how would you use them in a program.

Answer

atoi()         Converts a string to an integer.


itoa()         Convert an integer to a string


gcvt()        Converts a floating-point number to a string


 


#include "stdlib.h"


main()


{


      char s[] = "12345";


      char buffer [15], string[20];


      int i;


      


      i = atoi (s);


      printf("\n%d",i);


 


       gcvt (20.141672, 4, buffer);


       printf ("\n%s", buffer);


 


       itoa(15, string,2);


        printf ("\n%s", string);


}

Report Error

View answer Workspace Report Error Discuss

Subject: Programming

2 6437
Q:

Which type of entity is related to two or more associated entities that each contain specialized attributes that apply to some but not all of the instances of the entity?

A) Supertype entity B) Subtype entity
C) Archetype entity D) Instance entity
 
Answer & Explanation Answer: A) Supertype entity

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Database

2 6385
Q:

What is the Maximum clock frequency in 8086?

Answer

5 Mhz is the Maximum clock frequency in 8086.

Report Error

View answer Workspace Report Error Discuss

Subject: Hardware

2 6373
Q:

What is the resident set and working set of a process?

Answer

Resident set is that portion of the process image that is actually in real-memory at a particular instant. Working set is that subset of resident set that is actually needed for execution. (Relate this to the variable-window size method for swapping techniques.)

Report Error

View answer Workspace Report Error Discuss

1 6252