Technical Questions

Q:

Write a c program to create dos command type.

Answer

#include
int main( int count,char * argv[] ) {
    int i;
    FILE *ptr;
    char *str;
    char ch;
    if( count == 1) {


         printf( "The syntax of the command is incorrect.\n" );
    }
    for( i=1;i<cout;i++ ){
         ptr=fopen(argv[i],"r");
         if(ptr==NULL){
             printf("The system cannot find the file specified.");
             if(count>2)
                 printf("\nError occurred while procesing : %s.\n",argv[i]);
         }
         else {
             if(count>2) {
                 printf("%s\n\n",argv[i]);
             }
             while((ch=getc(ptr))!=-1)
                 printf("%c",ch);
         }
         fclose(ptr);
    }
    return 0;
}


 


Save the above file as open.c, compile and execute the go to command mode (current working directory) and write: open xy.c (xy.c any file present in that directory)
To run the open command in all directories and drive you will have to give the path of current working directory in command mode. Write:
C:tc\bin>PATH c:\tc\bin
Now press enter key. Now your open command will work in all directory and drive.

Report Error

View answer Workspace Report Error Discuss

Subject: Programming

0 2756
Q:

Write a c program for insertion sort.

Answer

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

  int i,j,s,temp,a[20];

  printf("Enter total elements: ");
  scanf("%d",&s);

  printf("Enter %d elements: ",s);
  for(i=0;i<s;i++)
      scanf("%d",&a[i]);

  for(i=1;i<s;i++){
      temp=a[i];
      j=i-1;
      while((temp<a[j])&&(j>=0)){
      a[j+1]=a[j];
          j=j-1;
      }
      a[j+1]=temp;
  }

  printf("After sorting: ");
  for(i=0;i<s;i++)
      printf(" %d",a[i]);

  return 0;
}

Output:
Enter total elements: 5
Enter 5 elements: 3 7 9 0 2
After sorting:  0 2 3 7 9

Report Error

View answer Workspace Report Error Discuss

Subject: Programming

0 2737
Q:

Which interrupts has the highest priority?

Answer

TRAP has the highest priority


there are 2 types of interrupts external and internal. NMI has highest priority among all external interrupts, TRAP has highest priority among all internal interrupts. 

Report Error

View answer Workspace Report Error Discuss

Subject: Hardware

0 2735
Q:

How many jobs can be run concurrently on MVT?

Answer

15 jobs.

Report Error

View answer Workspace Report Error Discuss

1 2732
Q:

Which among the following is the relationship constraints

A) Cardinality ratio B) Participation constraints
C) Both A and B D) None of the above
 
Answer & Explanation Answer: C) Both A and B

Explanation:

Both of them are relation ship constraints

Report Error

View Answer Report Error Discuss

Filed Under: Database
Job Role: Database Administration

0 2700
Q:

SNOBOL is mainly used for

A) Text Operation B) String operations
C) List operations D) Numerical operations
 
Answer & Explanation Answer: B) String operations

Explanation:

SNOBOL is a high-level computer programming language used especially in manipulating textual data. It is mainly used for string operations and was developed between 1962 and 1967.

Report Error

View Answer Report Error Discuss

11 2679
Q:

What will be output of following c code?

void main()
{
struct india
{
char c;
float d;
};
struct world
{
int a[3];
char b;
struct india orissa;
};
struct world st ={{1,2,3},'P','q',1.4};
clrscr();
printf("%dt%ct%ct%f",st.a[1],st.b,st.orissa.c,st.orissa.d);
getch();
}

Answer

Output: 2 p q 1.400000

Report Error

View answer Workspace Report Error Discuss

Subject: Programming

1 2678
Q:

What are the various types of CPU registers in a regular operating system design ?

Answer

 Stack Pointer
 Index Registers
 Accumulators
 General Purpose Registers

Report Error

View answer Workspace Report Error Discuss

3 2677