NEW AND EXCLUSIVE : GO TO THE ONLINE TEST PAGE AND TEST YOURSELF THROUGH EXAMINATION

Interview Questions and Answers:Operating System Concepts-Set 1

Q).1 State three Basic purposes of an Operating System. 

Q).2 Can you tell me the main differences between operating systems for mainframe computers and personal computers? 

 Q).3 State the four steps that are required to run a program on a completely dedicated machine. 

 Q).4 What is the name of the part of machine level instruction, which tells the central processor what has to be done ? 

 Q).5 What is the major difficulty that a programmer must overcome in writing an operating system for a real-time environment ?

Read More!!

Interview Questions and Answer: Fundamentals of C-Set 3

Q.1
Write a function to create a Circular Link list.

Q.2
Are the following two statements identical?
char str[6] = "Tnl" ;
char *str = "Tnl" ;

Q.3
What is the difference between %d and %*d in c language?

Q.4
Tell me the difference between i++ and i+1 ?

Q.5
State the difference between macros and inline functions?


Read More!!

Interview Questions and Answer: Fundamentals of C-Set 2

Q.1
Can you tell me how to print largest of three numbers without using "if","while" or "do-while" statement in main() ?

Q.2
Is the following code fragment correct ?
const int x = 10 ;
int arr[x] ;

Q.3
Write a program to print infinite number.

Q.4
What is the use of semicolon at the end of every statement ?

Q.5
Tell me the difference between NULL and NUL.


Read More!!

Interview Questions and Answer: Fundamentals of C-Set 1

Q.1
Do you know about Dangling pointer in C ?

Q.2
What is the difference between Pretest loop and Posttest loop ?

Q.3
Can you find an entered number is EVEN or ODD without using any conditional statement ?

Q.4
What is the basic difference between '\0' and "" ?

Q.5
In printf() Function- What is the difference between "printf(..)" and "sprintf(..)"?


Read More!!

Find Out the Output of the C-codes

Friends here is five C-questions involving Switch Case.
Lets solve these......
Q.1
What will be output when you will execute following c code?

#include<stdio.h>
void main(){
int check=2;
switch(check){
case 1: printf("D.W.Steyn");
case 2: printf(" M.G.Johnson");
case 3: printf(" Mohammad Asif");
default: printf(" M.Muralidaran");
}
}


Q.2
What will be output when you will execute following c code?


#include
<stdio.h> 
#define L 10
void main(){
auto money=10;
switch(money,money*2){
case L: printf("Willian");
break;
case L*2:printf("Warren");
break;
case L*3:printf("Carlos");
break;
default: printf("Lawrence");
case L*4:printf("Inqvar");
break;
}
}

Q.3
What will be output when you will execute following c code?

#include
<stdio.h> 
void main(){
int const X=0;
switch(5/4/3){
case X: printf("Clinton");
break;
case X+1:printf("Gandhi");
break;
case X+2:printf("Gates");
break;
default: printf("Brown");
}
}

Q.4
What will be output when you will execute following c code?


#include
<stdio.h> 
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");
}
}

Q.5
What will be output when you will execute following c code?


#include
<stdio.h> 
void main(){
switch(*(1+"AB" "CD"+1)){
case 'A':printf("Pulp Fiction");
break;
case 'B':printf("12 Angry Man");
break;
case 'C':printf("Casabance");
break;
case 'D':printf("Blood Diamond");
}

}


Read More!!

What will be the Output Of the Following C-codes?

Q.1
Which of the following statements are correct about an array?

a:The array int num[26]; can store 26 elements.
b:The expression num[1] designates the very first element in the array.
c:It is necessary to initialize the array at the time of declaration.
d:The declaration num[SIZE] is allowed if SIZE is a macro.


Q.2
If char=1, int=4, and float=4 bytes size, What will be the output of the program ?

#include<stdio.h>


int main()
{
char ch = 'A';
printf("%d, %d, %d", sizeof(ch), sizeof('A'), sizeof(3.14f));
return 0;
}

Q.3
What will be the output of the program ?

#include<stdio.h>

int main()
{
char str[] = "Nagpur";
str[0]='K';
printf("%s, ", str);
str = "Kanpur";
printf("%s", str+1);
return 0;
}


Read More!!

What will be the Output Of the Following C-codes?

Q.1
Point out the error, if any in the program.

#include<stdio.h>
int main()
{
int P = 10;
switch(P)
{
case 10:
printf("Case 1");

case 20:
printf("Case 2");
break;

case P:
printf("Case 2");
break;
}
return 0;
}

Q.2
What will be the output of the program?


#include<stdio.h>
int main()
{
int i=2;
printf("%d, %d\n", ++i, ++i);
return 0;
}



Q.3
 In the expression a=b=5 the order of Assignment is NOT decided by Associativity of operators



A.true
B.false


Read More!!

What will be the Output Of the Following C-codes?

Q.1
How many times the program will print "TheNextLevel" ?

#include <stdio.h>
int main()
{
printf("TheNextLevel");
main();
return 0;
}


Q.2
How many times the while loop will get executed if a short int is 2 byte wide?


#include<stdio.h>

int main()
{
int j=1;
while(j <= 255) 

 { 
 printf("%c %d\n", j, j); 
 j++; 
 } 
 return 0; 



 Q.3 Which of the following errors would be reported by the compiler on compiling the program given below? 

 #include<stdio.h>
int main()
{
int a = 5;
switch(a)
{
case 1:
printf("First");

case 2:
printf("Second");

case 3 + 2:
printf("Third");

case 5:
printf("Final");
break;

}
return 0;
}


Read More!!

What will be the Output Of the Following C-codes?

Q.1

#include<stdio.h>
int main(){
volatile int a=11;
printf("%d",a);
return 0;
}


Choose all that apply:
(A) 11
(B) Garbage
(C) -2
(D) We cannot predict
(E) Compilation error

Q.2

#include<stdio.h>

const enum Alpha{
X,
Y=5,
Z
}p=10;
int main(){
enum Alpha a,b;
a= X;
b= Z;
printf("%d",a+b-p);
return 0;
}


Choose all that apply:
(A) -4
(B) -5
(C) 10
(D) 11
(E) Error: Cannot modify constant object


Read More!!

What will be the Output Of the Following C-codes?

Q.1

main()
{
int i=0;
for(;i++;printf("%d",i)) ;
printf("%d",i);
}


Q.2

#include<stdio.h>
#include<conio.h>
main()
{
int i;
for(i=1;i<=5;printf("%d\n",i)) i++; 

getch(); 
}

Read More!!

What is Kernel level Threads ?

The identity of a Kernel level thread is known to the OS Kernel. A process creates threads in a way analogues to the create-process call.Let us call this create-thread call.One of the parameters of this call is the start address of thread in the code of creating process.The Karnel creates appropriate data structures for the new thread and assigns it an id.The call




returns with the id of the thread.The process creating the thread can use this id for synchronization purpose.The Kernel data structure for a thread would be a subset of the data structure for a process.A thread control block would be needed analogues to PCB fields which store resource allocation information would not be needed.The scheduler use the thread control block for the purpose of scheduling.The context switching actions are now of two kinds.The kernel would only save and load the CPU state while switching between threads of the same process.It would save and load the process environment if the thread being interrupted and the thread being scheduled to run belong to different processes.

    Kernel level threads can use all the privileges and facilities provided by processes themselves.Thusthey can make system calls to convey this resource and I/O requirements to the OS.

Difference with pure user level threads:

A kernel level thread (KLT) is a thread that the kernel is aware of, i.e. the kernel can decide which KLT will be schedule (assigned ot the CPU). Pure user level threads (PULTs) are not known to the kernel: One or more PULTs may run on top of a KLT and the kernel can only schedule the KLT. The decision which of the PULTs is scheduled is left to the user level scheduler in your application.
There are some tradeoffs between PULTs and KLTs and there are even hybrid models but the following problem remains: The kernel can only schedule KLTs to run on a given CPU. If you have more than one CPU/core then the kernel can schedule two KLTs to run concurrently.
For example you could decompress two JPEGs at the same time in your web browser if you have two cores on your CPU.

Ruby only offers PULTs. What does this mean? This means that you cannot have one Ruby process with two threads running at the same time. You cannot, for example, let a Rails process generate two differently sizted thumbnails of an uploaded image at the same time. You cannot answer more than one request at the same time without stopping the other thread. You cannot do numerical computations on more than one core at the same time.


Read More!!

What will be the Output Of the Following C-codes?

Q.1

#include<stdio.h>
int main(){
char p[]="String";
if(p=="String"){
printf("Pass 1");
if(p[sizeof(p)-2]=='g')
printf("Pass 2");
else
printf("Fail 2");
}
 else{
printf("Fail 1");
if(p[sizeof(p)-2]=='g')
printf("Pass 2");
else
printf("Fail 2");
}
return 0;
}





Q.2

func(int a,int b);
void main()
{
int i=7,j=8;
printf("%d\n",func(i,j));
}
func(int a,int b)
{
a=a-b;
b++;
return(b||a+--b);
}

Read More!!

What will be the Output Of the Following C-codes?

Q.1

#include<stdio.h>
int main(){
const int *p;
int a=10;
p=&a;
printf("%d",*p);
return 0;
}

Which one is correct?
(A) 0
(B) 10
(C) Garbage value
(D) Any memory address
(E) Error: Cannot modify const object


Q.2

#include<stdio.h>

int main(){
int a= sizeof(signed) +sizeof(unsigned);
int b=sizeof(const)+sizeof(volatile);
printf("%d",a+++b);
return 0;
}

Which one is correct?
(A) 10
(B) 9
(C) 8
(D) Error: Cannot find size of modifiers
(E) Error: Undefined operator +++


Read More!!

What will be the Output Of the Following C-codes?

Q.1


#include<stdio.h>
int main(){
double num=5.2;
int var=5;

printf("%d\t",sizeof(!num));
printf("%d\t",sizeof(var=15/2));
printf("%d",var);
return 0;
}

Q.2


 #include<stdio.h>

int main(){
printf("%d\t",sizeof(6.5));
printf("%d\t",sizeof(90000));
printf("%d",sizeof('A'));
return 0;
}


Read More!!

Find your computer “male” or “female” ???

Want to know that your pc is male or female???
Just follow the simple notepad trick.
Open notepad and type the following code


CreateObject("SAPI.SpVoice").Speak"I love you"
Save file as computer_gender.vbs & click on "save as type" as All Files.

Run the file ...
If you hear a male voice, you have a boy,
If you hear a female voice, you have a girl..............!!
Must Try ......!!! :)
mine is male..!!!


Read More!!

Make an Antivirus

If you are not able or do not want to buy an antivirus software then you can make your own antivirus by a simple notepad code.Here you have to do just....
1.Open notepad.

2.Copy the following code and paste it in the notepad




@echo off
title Antivirus
echo Antivirus
echo created by your name
:start
IF EXIST virus.bat goto infected
IF NOT EXIST virus.bat goto clean
cd C:\Windows\system32
:infected
echo WARNING VIRUS DETECTED!
del virus.bat
pause
goto start
:clean
echo YOUR COMPUTER IS PROTECTED
pause
exit

3.Change the "Save as type" section into "All Files,with the file name as you wish and the extension should be .BAT and click save.


4.Now double click on the bat file and you will observ a command prompt window doing a scan.




Thats it.


Read More!!

ONLINE TEST

    OPERATING SYSTEM




Read More!!

Logic Of Insertion Sort

In insertion sort, sorting is done by inserting a particular element at the appropriate position.
In the First iteration, second element A[1] is compared with the first element A[0]. In the second iteration third element is compared with first and second element. Actually in every iteration an element is compared with all the elements before it. While comparing if it is found that the element can be inserted at a suitable position, then space is created for it by shifting the other elements one position up and inserts the desired element at the suitable position. This procedure is repeated for all the elements in the list untill we get the ultimate sorted elements.


Here is a pictorial representation of logic of Insetion sort:
















Program in C: 

for sorting elements in ascending order




#include<stdio.h>
#include<conio.h>
void main()
{
int A[20], N, Temp, i, j;
clrscr();
printf("ENTER THE NUMBER OF TERMS:  ");
scanf("%d", &N);
printf("\n ENTER THE ELEMENTS OF THE ARRAY:  ");
for(i=0; i<N; i++)
{
gotoxy(25,11+i);
scanf("\n\t\t%d", &A[i]);
}
for(i=1; i<N; 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("\n\THE ASCENDING ORDER IS LIKE THIS:  ");
for(i=0; i<N; i++)
printf("\n\t\t\t%d", A[i]);
getch();
}




Read More!!

ONLINE TEST

DATABASE MANAGEMENT SYSTEM




Read More!!

ONLINE TEST

 COMPUTER NETWORKING



 


Read More!!