What is the role of linker in program execution?
a linker is a computer program which takes one or more object files generated by compiler and link them link them to standard library and produce one executable object file. The libraries includes operating system libraries, language specific libraries and ,may be, user created libraries.
Strong number program using c?
Nikhil Aggarwal
strong_number: The sum of factorials of digits of a number is equal to the original number.
void strong_number()
{
int num,i,p,r,sum=0,save_num;
printf("\nEnter a number");
scanf("%d",&num);
save_num=num;
while(num)
{
i=1,p=1;
r=num%10;
while(i<=r)
{
p=p*i;
i++;
} //while
sum=sum+p;
num=num/10;
} //while
if(sum==save_num)
printf("%d is a Strong number", save_num);
else
printf("%d is not a Strong number", save_num);
}
The user mode is :a mode that prvides an interface between the application and the OS and only has access to the hardware resources through rhe code running in kernel mode .Type your answer here...
A pointer to function which receives an int pointer and returns a float pointer?
float *(*funptr)(int *);
float *fun (int *);
funptr= fun;
C program to print the format 4 1 44 11 444 111 4444 1111 000000000 444444 3333 22 1?
#include <stdio.h>
int main (void) { puts ("4 1 44 11 444 111 4444 1111 000000000 444444 3333 22 1"); return 0; }
Who invented monochrome monitor?
I doubt this can be exactly determined. Some early computers using CRT DRAM for memory had an extra tube that could be switched to any bank to display memory contents as dots for 1's, this might be considers a monochrome monitor though it was of limited use. Many early computers that needed a display used RADAR tubes. On microcomputers in the 1970s an ordinary TV was used. There were probably many inventors, of many different forms.
What is tree abstract data type?
It is my opinion that you're just looking at a tree structure for data; calling it asbstract just means you're not looking at a concrete implementation - rather the idea of tree data structuring.
There are a couple of links below to get you started
http://en.wikipedia.org/wiki/Tree_(computer_science)
http://www.sqa.org.uk/e-learning/LinkedDS04CD/index.htm
WRT it being a data type, it depends on the language. Some have Tree Types in the language, C# for example, some require you to build your own.
I hope this helps - if not I'm sure someone much wiser than I will come along...
How can you convert an angle expressed in degrees into radians?
Basically, if the original angle is alpha, the new value is:
(alpha*PI)/180. For example, for 90 degrees you will get:
(90*PI)/180 which is PI/2.
How do you debug a program that is already running?
Assuming that you have written a program named abc.c and created executable abc.
Steps:
1. run your program from command line ./abc
3. get the PID processid of the program from PS aux | grep abc
3. start the gdb from command line
4. type following command on GDB prompt
(gdb) attach PID
where PID = your program's processid got from step 1.
Who is better quick sort or merge sort?
Statistically both MergeSort and QuickSort have the same average case time: O(nlog(n)); However there are various differences.
Most implementations of Mergesort, require additional scratch space, which could bash the performance. The pros of Mergesort are: it is a stable sort, and there is no worst-case scenario.
Quicksort is often implemented inplace thus saving the performance and memory by not creating extra storage space. However the performance falls on already sorted/almost sorted lists if the pivot is not randomized.
== ==
Yes, but you will need to enclose the string in quotes on both sides of the ==. For example...
@ECHO OFF
SET M=Firstname Surname
IF "%M%"=="Firstname Surname" (ECHO It works!) ELSE ECHO Failure!
PAUSE
EXIT
Shell script that copies multiple files to a directory?
That's what cp(1) program is good for: cp this that "something else" /dir/to/
Write a program to print factorial of n numbers starting from x?
In C++:
#include <iostream>
using namespace std;
int fact(int x);
int main()
{
int x, total;
cout << "Enter a number: ";
cin >> x;
total = fact(x);
cout << "The factorial of " << x << " is: " << total << endl;
char wait;
cin >> wait;
return 0;
}
int fact(int x)
{
if(x == 1)
{
return 1;
}
return fact(x - 1) * x;
}
In computer programing language which is used for functional programing?
Agda, Charity, Clean, Coq (Gallina), Curry, Elm, Frege, Futhark, Haskell, Hope, Idris, Joy, Mercury, Miranda, Owl, Lisp, Purescript, QML and SequenceL are all "pure" functional languages.
The impure functional languages are predominantly imperative languages with declarative (functional) features and include C++ since C++11 and Java since Java 8.
A register used to store an address of something in memory. Its invention eliminated the need to write self modifying code.
MAKEFILE is used when compiling large CPP projects for faster compilation. When you change a single file, only this file can be recompiled instead of everything. It comprises of 3 components: target, dependencies and system commands. Based on a time stamp the compiler recompiles the target.
If in case one of its dependencies is also a target, and has a more recent time stamp, this dependency is recompiled before the actual target specified as the first argument. Therefore if you consider this as a tree and each node has its children as its dependencies, then a post order traversal will accomplish our task. While traversing each node the corresponding dependency can be recompiled if its time stamp is higher than its parent.
What kinds of storage devices do large computer systems use?
Large computer systems usually use purpose specific storage based on the requirements of the system. For instance, a large file server would use several racks of simple storage servers usually via something like iSCSI over fiber or Infiniband. A large super computer may not need that much storage, but it would need to be faster, so there would be large RAM requirements with little permanent storage to speak of. A Cray CX1 Supercomputer can have up to 64 Processors interconnected, but while a large computing system, usually has less need for disk space. The HP NonStop OS for highly available "never go offline" kind of systems are used for things like certain stock exchanges, and have both a large number of storage disks and a large amount of RAM in most applications.
Specific Disk types are traditionally SCSI or SAS drives, but the rise of SATA speeds and reliablity, coupled with the much cheaper cost means many storage systems are moving to the new SATA standards. SCSI has higher reliability, but if an SATA drive can store more, and for a fourth of the cost, it's sometimes more cost effective to create a storage array that can stand to lose several drives from a RAID array, and simply have disks on hand to replace them as they go. SCSI is still used in situations where such maintenance is not much of an option.
What is slack byte in structures in C?
it's a byte used for speed optimization. It aligns bytes so that the can be read from the structure faster.
Its an extra byte, sometimes placed between structure members to align other structure members on appropriate word, double word, or quad word boundaries. It is often necessary when mixing libraries between different vendors, so as to make sure the structures align correctly and have the proper performance. Slack byte control, in the Microsoft world, is controlled by the /zpx compiler parameter. I have also seen the need to deal with slack bytes when programming with mixed assembler and COBOL in a mainframe environment, in the working storage division.