hi folks i m approching for h1 b interview on monday 8th of
august at montreal and i m having little problem in my
approval notice abt my bithdate my employer has made a
mistake while applying it is 12th january and istead of
that he had done 18 the of january do any body have any
solution for that if yes how can i prove my visa officer
abt my real birthdate it urgent please let me know guys
thaks dipesh patel
The OS is a program that uses various data structures. Like
all programs in execution, you can determine the
performance and other behavior of the OS by inspecting its
state - the values stored in its data structures. In this
part of the assignment, we study some aspects of the
organization and behavior of a Linux system by observing
values of kernel data structures exposed through the /proc
virtual file system.
The /proc virtual file system:
Linux uses the /proc file system to collect information
from kernel data structures. The /proc implementation
provided with Linux can read many different kernel data
structures. If you cd to /proc on a Linux machine, you will
see a number of files and directories at that location.
Files in this directory subtree each corresponds to some
kernel data structure. The subdirectories with numeric
names contain virtual files with information about the
process whose process ID is the same as the directory name.
Files in /proc can be read like ordinary ASCII files. You
can open each file and read it using library routines such
as fgets() or fscanf(). The proc (5) manual page explains
the virtual files and their content available through
the /proc file system.
Requirements in detail:
In this part, you are asked to write a program to report
the behavior of the Linux kernel. Your program should run
in two different versions. The default version should print
the following values on stdout:
Processor type
Kernel version
The amount of memory configured into this computer
Amount of time since the system was last booted
A second version of the program should run continuously and
print lists of the following dynamic values (each value in
the lists is the average over a specified interval):
The percentage of time the processor(s) spend in
user mode, system mode, and the percentage of time the
processor(s) are idle
The amount and percentage of available (or free)
memory
The rate (number of sectors per second) of disk
read/write in the system
The rate (number per second) of context switches in
the kernel
The rate (number per second) of process creations
in the system
If your program (compiled executable) is called proc_parse,
running it without any parameter should print out
information required for the first version. Running it with
two parameters "proc_parse <read_rate> <printout_rate>"
should print out information required for the second
version. read_rate represents the time interval between two
consecutive reads on the /proc file system. printout_rate
indicates the time interval over which the average values
should be calculated. Both read_rate and printout_rate are
in seconds. For instance, proc_parse 2 60 should read
kernel data structures once every two seconds. It should
then print out averaged kernel statistics once a minute
(average of 30 samples). The second version of your program
doesn't need to terminate.
The purpose of this exercise is to benchmark file writing
and reading speed. This exercise is divided into two parts.
a). Write a file character by character such that the total
file size becomes approximately >10K. After writing close
the file handler, open a new stream and read the file
character by character. Record both times. Execute this
exercise at least 4 times
b). Create a buffer capable of storing 100 characters. Now
after generating the characters, first store them in the
buffer. Once the buffer is filled up, store all the
elements in the file. Repeat the process until the total
file size becomes approximately >10K.While reading read a
while line, store it in buffer and once buffer gets filled
up, display the whole buffer. Repeat the exercise at least
4 times with different size of buffer (50, 100, 150 ).
Records the times.
c). Do an analysis of the differences in times and submit
it in class.
Write a program which has the following seven functions.
The functions should be:
main() this calls the other 6 functions
fget_long() a function which returns a long data
type from a file
fget_short() a function which returns a short
integer variable from a file
fget_float() a function which returns a floating
point variable from a file
fprt_long() a function which prints its single,
long argument into a file
fprt_short() a function which prints its single,
short argument into a file
fprt_float() a function which prints its single,
floating point argument into a file.
You should use fscanf() to get the values of the variables
from the input (the file) and fprintf() to print the values
to the other file. Pay attention to using the correct
format for each of the data types.
71
Define function pointers?
12
can any one tel me wt is the question pattern for NIC exam
How do you initialize function pointers? Give an example?
6
what is a void pointer?
12
hi friends how r u as soon in satyam my interview is start
but i m very confusued ta wat i do plz help me frndz wat
can i do plz tell me some question and answers related
with "C" which r asked in the interview .
The purpose of this exercise is to benchmark file writing
and reading speed. This exercise is divided into two parts.
a). Write a file character by character such that the total
file size becomes approximately >10K. After writing close
the file handler, open a new stream and read the file
character by character. Record both times. Execute this
exercise at least 4 times
b). Create a buffer capable of storing 100 characters. Now
after generating the characters, first store them in the
buffer. Once the buffer is filled up, store all the
elements in the file. Repeat the process until the total
file size becomes approximately >10K.While reading read a
while line, store it in buffer and once buffer gets filled
up, display the whole buffer. Repeat the exercise at least
4 times with different size of buffer (50, 100, 150 ).
Records the times.
c). Do an analysis of the differences in times and submit
it in class.
111
3. When do you say that a digraph is acyclic
A)if and only if its first search does not have back arcs
B)a digraph is acyclic if and only if its first search does
not have back vertices
C)if and only if its first search does not have same
dfnumber
D)None of these
Write an interactive c program that will encode or decode a
line of text. To encode a line of text, proceed as follows:
Convert each character, including blank spaces, to its
ASCII equivalent.
Generate a positive random integer. Add this integer to the
ASCII equivalent of each character. The same random integer
will be used for the entire line of text.
Suppose that N1 represents the lowest permissible value in
the ASCII code, and N2 represents the highest permissible
value. If the number obtained in step 2 above exceeds N2,
then subtract the largest possible multiple of N2 from this
number, and add the remainder to N1. Hence the encoded
number will always fall between N1 and N2, and will
therefore always represent some ASCII character.
Display the characters that correspond to the encoded ASCII
values.
The procedure is reversed when decoding a line of text. Be
certain, however, that the same random number is used in
decoding as was used in encoding.
hi folks i m approching for h1 b interview on monday 8th of
august at montreal and i m having little problem in my
approval notice abt my bithdate my employer has made a
mistake while applying it is 12th january and istead of
that he had done 18 the of january do any body have any
solution for that if yes how can i prove my visa officer
abt my real birthdate it urgent please let me know guys
thaks dipesh patel
94
Write a C program on Centralized OLTP, Decentralized OLTP
using locking mechanism, Semaphore using locking mechanism,
Shared memory, message queues, channel of communication,
sockets and a simple program on Saving bank application
program using OLTP in IPC?
167
What is mean by Data Driven framework in QTP? Can any one
answer me in details on this regard.
the factorial of non-negative integer n is written n! and
is defined as follows:
n!=n*(n-1)*(n-2)........1(for values of n greater than or
equal to 1 and
n!=1(for n=0)
Perform the following
1.write a c program that reads a non-negative integer and
computes and prints its factorial.
2. write a C program that estimates the value of the
mathematical constant e by using the formula:
e=1+1/!+1/2!+1/3!+....
3. write a c program the computes the value ex by using the
formula
ex=1+x/1!+xsquare/2!+xcube/3!+....