sasikala's blog

IT / Computer - Acronyms and Abbreviations

1. ODBC means open data base connectivity

2. ASCII stands for american standard for information interchange

3. FLOPS stands for floating point operation per second

4. RAID stands for redundant array of independent disks or redundant array of inexpensive disks

C Problems and Solutions - 2

6. What is the output?

#include<stdio.h>
main(){
char a[]="hellow";
char *b="hellow";
char c[5]="hellow";
printf("%s %s %s ",a,b,c);
printf(" ",sizeof(a),sizeof(b),sizeof(c));
}

Ans: hellow,hellow,hellow
6,2,5

7. What is the output?

#include<stdio.h>
main()
{
float value=10.00;
printf("%g %0.2g %0.4g %f",value,value,value,value)
}

Ans : 10,10,10,10.000000

8. main()
{
funct(int n);
{
switch(n)
case1:
m=2;
break;
case2:
m=5;
break;
case3:
m=7;
break;
default:
m=0;
}

Ans : output is m=0

9. #include<stdio.h>
void function1;
int i-value=100;
main()
{
i-value=50;
function1;
printf("i-value in the function=",i-value);
printf("i-value after the function=",i-value);
}
printf("i-value at the end of main=",i-value);
functioni()
i-value=25;

Ans: i-value in the function=25;
i-value after the function=50;
i-value at the end of the main=100;

10. what is output of the following program
main()
{
int i=3;
while(i--)
{
int i=100
i--;
printf("%d..",i);
}
}

Ans: 99..99..99..99

C Problems and Solutions

1. What is wrong in the following problem
#include
main() {
int i,j;
j = 10;
i = j++ - j++;
printf("%d %d", i,j);
}
Ans: 0, 12

2. What is the output of the following problem
#include
main() {
int j;
for(j=0;j<3;j++)
foo();
}
foo() {
static int i = 10;
i+=10;
printf("%d\n",i);
}

Ans: i is static variable, so output is

20
30
40

3. What is wrong in the following code

#include
#include

main()
{
char *c;
c = "Hello";
printf("%s\n", c);
}

Ans: Hello, The code is successfully running

4. What is the final value of i and how many times loop is executed ?

#include
main()

{
int i,j,k,l,lc=0;
/* the input is given as 1234 567 */
printf("Enter the number string:<1234 567 >\n");
scanf("%2d%d%1d",&i,&j,&k);
for(;k;k--,i++)
for(l=0;l printf("%d %d\n",i,l);}
printf("LOOPS= %d\n", lc-1);
}
Ans: i = 16, and loop is executed for 169 times

5. What is the output of the following program

#include
main() {
union {
int a;
int b;
int c;
} u,v;
u.a = 10;
u.b = 20;
printf("%d %d \n",u.a,u.b);
}

Ans : 20 20
Read More

Unix interview / Learning Questions

23.If a directory contains public files which should not be altered,the most liberal permissions that can be given to the directory is
Ans 755

24. After the following command is executed
$ ln old new

a listing is performed with the following output

$ ls -li

total 3

15768 -rw-rw-rw- 2 you 29 Sep 27 12:07 old
15768 " " " " " " " " new
15274 " " 1 " 40 " " 09:34 veryold

which of the following is true

a)old and new have same i-node number,2
b) " " " " " " " , 15768
c)old and new have nothing yo do with each other
d)very old and new are linked
e)very old and old are linked

Ans: old and new have same i-node number, 15768

25. The command ......ln /bin/mail /usr/you/bin/m

a)will not be executed because you are linking files across different file systems
b)results ln /bin/mail being the same file as /usr/you/bin/m
c)results in 2 links to the file mail
d) " " " " m
e)none

Ans: b

26. In a standard directory lay out, /etc is the directory where

a) basic programs such as who and ed reside

b)various administrative files such as password file reside

Ans: b

27. The UNIX system call that transforms an executable binary file into

a process is
a)execl()
b)execv()
c)execle()
d)execve()
e)All of the above

Ans : d

Unix - Questions - Interview / Learning

13. What does chmod 654 stand for.

Ans : _rw_r_xr__

14. Which of following is used for back-up files?

(a) compress (b) Tar (c) make (d) all the above

Ans : b

15. what does find command do ?

Ans : search a file

16. The very first process created by the kernal that runs till the kernal process is haltes is

Ans : init

17. The UNIX shell is....

Ans : forms the interface between the user and the kernal

18. In UNIX a files i-node
Ans : is a data structure that defines all specifications of a file like the file size ,number of lines to a file ,permissions etc.

19. Which of the following is true

a)UNIX is a time sharing multi-user OS
b)UNIX has a device independent file system
c)UNIX is full duplex
d)UNIX has command interpreter
e)All of the above

Ans: e

20. Interprocess communication in UNIX can be achieved using

a)pipe
b)Message
c)Semaphores
d)Shared Memory
e)All of the above

Ans : e

21. Which of the following is true about fork()

Ans : causes the creation of a new process ,the CHILD process with a new process ID

22. until who|grep mary
do
sleep 60
done
a) is syntactically incorrect
b) waits 60 seconds irrespective of Mary being logged in or not
c) waits until Marry is logged in
d)waits till Mary exited
e)None

Ans : c

Unix - Questions - Interview / Learning

1. To display the contents of a executable file the following command can be used

Ans : od

2. Assume the current directory contains 10 files and does'nt contain 'temp'. What will be the output of the follwing commands?

$ls > temp
$wc -l temp

Ans : 10

Syndicate content