What is static extern variables in C?
Basically storage class defines the accessibity of a variable. If you specify a variable with auto storage class, then that variable can be accessed only in that function or block where it is declared. if you specify a variable with static storage class, it has the same visibily like an auto variable but it can retains it's value between function calls where as an auto variable cannot. look at this example: void main() { int i,j ;
for(j = 0; j< =2; j++) { i = fun1(); printf("%d",i); } } int fun1() { static int k =0; k = k+1; return k; } it prints 1 2 3
What is the INT86 function in C programming?
INT 86 Int86() is a C function that allows to call interrupts in the program. prototype in dos.h In and out register must be type of REGS. REGS is a built in UNION declaration in C. It is defined in the header file <DOS.h>
Two example pervasive computing?
Human-computer interaction Human–computer interaction (HCI) is the study of interaction between people (users) and computers. It is often regarded as the intersection of computer science, behavioral sciences, design and several other fields of study. Interaction between users and computers occurs at the user interface (or simply interface), which includes both software and hardware, for example, general-purpose computer peripherals and large-scale mechanical systems, such as aircraft and power plants.
Characteristics of a good computer program?
The following are the characteristics of a programming language
1. Readability: A good high-level language will allow programs to be written in some ways that resemble a quite-English description of the underlying algorithms. If care is taken, the coding may be done in a way that is essentially self-documenting.
2. Portability: High-level languages, being essentially machine independent, should be able to develop portable software.
3. Generality: Most high-level languages allow the writing of a wide variety of programs, thus relieving the programmer of the need to become expert in many diverse languages.
4. Brevity: Language should have the ability to implement the algorithm with less amount of code. Programs expressed in high-level languages are often considerably shorter than their low-level equivalents.
5. Error checking: Being human, a programmer is likely to make many mistakes in the development of a computer program. Many high-level languages enforce a great deal of error checking both at compile-time and at run-time.
6. Cost: The ultimate cost of a programming language is a function of many of its characteristics.
7. Familiar notation: A language should have familiar notation, so it can be understood by most of the programmers.
8. Quick translation: It should admit quick translation.
9. Efficiency: It should permit the generation of efficient object code.
10. Modularity: It is desirable that programs can be developed in the language as a collection of separately compiled modules, with appropriate mechanisms for ensuring self-consistency between these modules.
11. Widely available: Language should be widely available and it should be possible to provide translators for all the major machines and for all the major operating systems.
OOP (Object Oriented Programming) is the implementation phase of OOD. OOD (Object Oriented Design) is a philosophy that considers things as objects that have attributes and methods. There can be public attributes and methods, and there can be private attributes and methods. The public interface is used to design the relationship between the object and its users, while the private interface is used to design the implementation of how that object works. If done correctly, the private implementation can be changed without requiring any change to the public interface or to its users. Often, a new object can be defined as a derivation of some other object, such as an officer is an employee. The derivation would add the necessary public and private aspects of an officer while inheriting the prior implementation of the public and private aspects of an employee.
What was the name of the destructive volcano in Hawaii?
The big island of Hawaii is made up of five volcanoes: Kohala, Hualalai, Mauna Loa, Mauna Kea, and Kilauea.
Kilauea is the most famous of these volcanoes and is one of the most active volcanoes in the world.
Any device or construct that allows a human being to interact with a machine is an interface. The steering wheel of a car is an interface, the play button on a DVD video player is an interface, the close icon on a window is an interface, the CTRL+C accelerator is an interface, and so on.
The horizontal axis for a chart is called the x-axis or the what in Excel?
The independent variable is on the horizontal axis.
What is pure virtual functions?
In C++, a pure virtual function is a function declaration that has no implementation in the class where it is declared, but is rather left to the child classes to override and define the function. This means that the parent class cannot be instantiated. In Java this is known as an abstract class or interface.
1 22 333 4444 how to create c program?
1 22 333 4444 Any text editor is usable for that.
1 22 333 4444 But if your question was about printing this sequence for nth term, then:
#include
#include
void main()
{
int n,i,j;
clrscr();
printf("Enter the last limit\n");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
for(j=1;j<=i;j++)
{
printf("%d",i);
}
}scanf(" ");
getch();
}
Hey look the above code will print out the series up-to the nth limit which is inputed from the user.
If u use only puts() then u have limitation, i.e. u can't print the series up-to nth term in a normal way and generally this program appears in series up-to nth term.
Thank u.
What is the role of encryption in data transfer?
putting a password on a file, or coding the data so to anyone able to open it is unable to read it unless they decode it. usually decoding is very hard and almost impossible for those who dont posess the decode thing usually sent to the other guy who is receiving the document.
Advantages and disadvantages of software upgrade?
Advantages: They prevent unauthorized access or at least make it more difficult
Disadvantages: They require resources to run, add complexity to the IT environment and require effort by those using the systems.
How do you delete last element from link list?
void
delete_last (node **head)
{
node *tmp = *head;
node *prev = NULL;
if (!tmp) {
} else if (!tmp->next) {
free(tmp);
*head = NULL;
} else {
while (tmp->next) {
prev = tmp;
tmp = tmp->next;
}
prev->next = NULL;
free(tmp);
}
return;
}
Write a c program to add two matrices using functions?
#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
int a[4][4],b[4][4],c[4][4],i,j;
printf("enter the elements of matrix a");
for(i=0;i<=3;i++)
for(j=0;j<=3;j++)
scanf("%d",&a[i][j]);
printf("the first matrix is");
for(i=0;i<=3;i++)
{
printf("\n");
for(j=0;j<=3;j++)
printf("%d",a[i][j]);
}
printf("Enter the elements of second matrix");
for(i=0;i<=3;i++)
for(j=0;j<=3;j++)
scanf("%d",&b[i][j]);
printf("the second matrix is");
for(i=0;i<=3;i++)
{
printf("\n");
for(j=0;j<=3;j++)
printf("%d",b[i][j]);
}
for(i=0;i<=4;i++)
for(j=0;j<=4;j++)
c[i][j]=a[i][j] + b[i][j];
printf("the addition of matrix is");
for(i=0;i<=3;i++)
{
for(j=0;j<=3;j++)
printf("%d\t",c[i][j]);
printf("\n");
}
getch();
} Answer by sujit saxena:
#include<stdio.h>
#include<conio.h>
void main()
{
int a[20][20],b[20][20],c[20][20],i,j,r1,r2,c1,c2,ta,tb;
clrscr();
printf("Enter order of Matrix A: ");
scanf("d",&r1,&c1);
ta=r1*c1;
printf("\nEnter %d elements=",ta);
for(i=0;i<r1;i++)
{
for(j=0;j<c1;j++)
scanf("%d",&a[i][j]);
}
printf("\nEnter order of Matrix B: ");
scanf("d",&r2,&c2);
tb=r2*c2;
if(r1==r2 && c1==c2)
{
printf("\nEnter %d elements=",tb);
for(i=0;i<r2;i++)
{
for(j=0;j<c2;j++)
scanf("%d",&b[i][j]);
}
for(i=0;i<r1;i++)
{
for(j=0;j<c2;j++)
c[i][j]=a[i][j]+b[i][j];
}
printf("\nSum of matrix is\n");
for(i=0;i<r1;i++)
{
for(j=0;j<c2;j++)
{
printf("%d\t",c[i][j]);
}
printf("\n");
}
}
else
printf("\nAdddition is not possible pls enter same matrices");
getch();
}
Advantages of ethical hacking?
Since security is week in all technical fields... ethical hackers are brought into work for the corporate sectors with high wages... All ethical hackers have a great scope in nearly future.. if you have any disagreement in my idea about ethical hackers you can mail your concepts to "pown.raj77@gmail.com" For futher informations about ethical hacking you can contact me through my mail id..
Enumeration types are an essential ingredient in writing human readable source code. Due to their special nature, special care must be taken when deciding how to use them and - even more importantly - assessing implications of their use. ex:- c++ enum myenum {white, black, red, green, blue, magenta, yellow, cyan }; the default value attached is {0,1,2,3,4,5,6,7} niv
What is a difference between register and a memory location?
difference between register and memory location
What is the advantage of direct implementation?
Direct coupling provides good frequency response and also very good DC amplification.It is simple to implement.
What is the number of nodes in a complete binary tree of level 5?
If the number of levels is L, the maximum number of nodes N in a binary tree is N = 2L-1.
For L = 5, N equates to 31 thus.
What is the difference between algorithm and pseudocode in computer science?
Pseudocode consists of short readable and formally-styled natural language used to explain specific tasks within a program's algorithm while an Algorithm is a set of instructions used to solve a particular problem.
What is a short formal document?
A short formal document should be structured with headlines or headings, to be followed by the concise and comprehensive content to indicate the theme or the mainpoints of your document A short formal document can be lots of different types of documents. A letter being one of them
How would you dynamically allocate a one-dimensional and two-dimensional array of integers?
To dynamically allocate an array, use 'void *realloc(void *array, size_t size)', where array is the pointer you plan on reallocating and size is the new length of the array in bytes.
One-dimensional array:
{
int len = 10;
int *array = NULL;
array = (int*)realloc(array, len * sizeof(int));
}
Two-dimensional array:
{
int xlen = 10;
int ylen = 10;
int **array2d = NULL;
array2d = (int**)realloc(array2d, xlen * sizeof(int*));
/* After reallocating array2d, do the same to its contents. */
int index;
for (index = 0; index < xlen; index++) {
array2d[index] = (int*)realloc(array2d[index], ylen * sizeof(int));
}
array2d[5][5] = 24;
/* Clean up. */
for (index = 0; index < xlen; index++) {
free(array2d[index]);
}
free(array2d);
return 0;
}
What are the Advantages of linked list over stack and queue?
A linked list is a data structure in which each node has a pointer to the next node, and thus the whole list is linked.
Some advantages are:
* Easy traversal of the whole list (simply follow the pointers) * Easy insertion and deletion of nodes (don't need to move all the other nodes around)