answersLogoWhite

0

📱

C Programming

Questions related to the C Computer Programming Language. This ranges all the way from K&R to the most recent ANSI incarnations. C has become one of the most popular languages today, and has been used to write all sorts of things for nearly all of the modern operating systems and applications. It it a good compromise between speed, power, and complexity.

9,649 Questions

G.M.Muktibodh the void?

the void written by gm muktibodh is a poem surrealistic poem which powerfully evokes the harrow ; destruction and violence that result from extreme self-absorption and sense of the meaninglessness of life . the word void here means the empty space (shoonya) or negative thinking which we have

What is the most efficient algorithm for language translation?

It is called MEPS, (Multilanguage Electronic Phototypesetting System)designed by the Watchtower and Bible Tract Society. various forms of MEPS are used in more than 125 locations around the earth, and this has helped to make possible publication of the semimonthly journal, The Watchtower, in over 130 languages simultaneously.

Is 9 an integer?

s.. 9 is an integer but 9.a23 or any other decimal value isn't integer
Yes.

What are the 6 types of c tokens?

A Token is the basic and the smallest unit of a program

There are 6 types of tokens in 'C'. They are:

1) Keywords

2) Identifiers

3) Constants

4) Strings

5) Special symbols

6) Operators

What is super economy class?

super economy class is a mid-ranged product between economy and business class. it was designed to give you a better flight for around the price of economy. super economy offers better features such as extra legroom, seats are wider and there is more seat recline. the meal and beverage service, however, is the same or very similar to that served in economy class.

the super economy class was introduced because air travel companies were hard up and needed something to increase their profits and give them more customers. this provided both although only in America, Europe and Scandinavia. however some airlines have deigned this new style of flight as costly and unneccesary and have abolished it within their companies and stuck to economy. there are several opinions on the new sysytem and all of them have a degree of credibility. the fact, is that super economy will only work with the airlines that market it right.

What is proprietary algorithm?

A proprietary algorithm is a sequence of steps or rules performed to achieve a specific goal, belonging to a commercial company as it has been trademarked or patented by its owner. An example is a search engine ranking algorithm for one of the commercial web search engines - some of the details may be readily available to the public but the source code is not freely available to protect company interests and prevent misuse.

The time complexity of the sequential search algorithm is?

O(N) where N is the number of elements in the array you are searching.So it has linear complexity.

C program for matrix minima method?

/*

PROGRAM BY SOUMEN KARMAKAR

College of Engineering and Management ,Kolaghat

3rd Year Information Technology

Note: Compile the program under Linux environment using gcc. If you want to compile it under turbo c then modify the program

*/

// Program to solve matrix Minima (Transportation Problem)

#include <stdio.h>

void input_data(int a[][10],int b[][10],int s[10],int d[10]);

void show_data(int a[][10],int b[][10],int s[10],int d[10]);

void matrix_min(int a[][10],int b[][10],int s[10],int d[10]);

int m,n;

int main(void)

{

int a[10][10],b[10][10],s[10],d[10];

printf("\nEnter the no of supply & demand\n");

scanf("%d %d",&m,&n);

input_data(a,b,s,d);

show_data(a,b,s,d);

matrix_min(a,b,s,d);

return (0);

}

void input_data(int a[][10],int b[][10],int s[10],int d[10])

{

int i,j;

printf("\nEnter the cost matrix\n");

for(i=0;i<m;i++)

{

for(j=0;j<n;j++)

scanf("%d",&a[i][j]);

}

for(i=0;i<m;i++)

{

for(j=0;j<n;j++)

b[i][j]=-1;

}

printf("\nEnter the supply \n");

for(i=0;i<m;i++)

scanf("%d",&s[i]);

printf("\nEnter the demand\n");

for(i=0;i<n;i++)

scanf("%d",&d[i]);

}

void show_data(int a[][10],int b[][10],int s[10],int d[10])

{

int i,j;

printf("\n \t\t\tSupply\n");

for(i=0;i<m;i++)

{

printf("\n");

for(j=0;j<n;j++)

{

printf("%d (%d) ",a[i][j],b[i][j]);

}

printf(" | %d",s[i]);

}

printf("\n------------------------\n");

printf("\nDemand ");

printf("%d ",d[i]);

}

void matrix_min(int a[][10],int b[][10],int s[10],int d[10])

{

int i,j,s1,d1,cost,min,t1,t2,sd;

int tag[10][10];

s1=0;

d1=0;

for(i=0;i<m;i++)

{

s1=s1+s[i];

}

printf("\nsupply= %d",s1);

for(j=0;j<n;j++)

{

d1=d1+d[j];

}

printf("\ndemand= %d",d1);

if(s1!=d1)

printf("\nIt is unbalanced\nSo new table is\n\n");

if(s1>d1)

{

n++;

for(i=0;i<m;i++)

{

a[i][n-1]=0;

b[i][n-1]=-1;

}

d[n-1]=s1-d1;

d1=s1;

show_data(a,b,s,d);

}

else if(s1<d1)

{

m++;

for(j=0;j<n;j++)

{

a[m-1][j]=0;

b[m-1][j]=-1;

}

s[m-1]=d1-s1;

s1=d1;

show_data(a,b,s,d);

}

//MAIN CALCULATION

for(i=0;i<m;i++)

{

for(j=0;j<n;j++)

{

tag[i][j]=-1;

}

}

printf("\nTag matrix \n");

for(i=0;i<m;i++)

{

printf("\n");

for(j=0;j<n;j++)

{

printf("%d ",tag[i][j]);

}

}

cost=0;

sd=0;

while(sd!=s1)

{

for(i=0;i<m;i++)

{

for(j=0;j<n;j++)

{

if(tag[i][j]==-1)

{

min=a[i][j];

t1=i;

t2=j;

break;

}

}

}

for(i=0;i<m;i++)

{

for(j=0;j<n;j++)

{

if(tag[i][j]==-1)

{

if(min>a[i][j])

{

min=a[i][j];

t1=i;

t2=j;

}

}

}

}

printf("\nMin =%d\n",min);

if(d[t2]==s[t1])

{

cost=cost+a[t1][t2]*s[t1];

b[t1][t2]=s[t1];

sd=sd+s[t1];

d[t2]=0;

s[t1]=0;

show_data(a,b,s,d);

for(j=0;j<n;j++)

{

if(tag[t1][j]==0)

continue;

tag[t1][j]=0;

}

for(i=0;i<m;i++)

{

if(tag[i][t2]==0)

continue;

tag[i][t2]=0;

}

printf("\nTag matrix \n");

for(i=0;i<m;i++)

{

printf("\n");

for(j=0;j<n;j++)

{

printf("%d ",tag[i][j]);

}

}

}

else if(d[t2]>s[t1])

{

cost=cost+a[t1][t2]*s[t1];

b[t1][t2]=s[t1];

sd=sd+s[t1];

d[t2]=d[t2]-s[t1];

s[t1]=0;

show_data(a,b,s,d);

for(j=0;j<n;j++)

{

if(tag[t1][j]==0)

continue;

tag[t1][j]=0;

}

printf("\nTag matrix \n");

for(i=0;i<m;i++)

{

printf("\n");

for(j=0;j<n;j++)

{

printf("%d ",tag[i][j]);

}

}

}

else

{

cost=cost+a[t1][t2]*d[t2];

b[t1][t2]=d[t2];

sd=sd+d[t2];

s[t1]=s[t1]-d[t2];

d[t2]=0;

show_data(a,b,s,d);

for(i=0;i<m;i++)

{

if(tag[i][t2]==0)

continue;

tag[i][t2]=0;

}

printf("\nTag matrix \n");

for(i=0;i<m;i++)

{

printf("\n");

for(j=0;j<n;j++)

{

printf("%d ",tag[i][j]);

}

}

}

}

printf("\nCost is =%d\n",cost);

}

// Thank You.........

Write cobol program to find sum of two numbers?

1. (B) WRITE A PROGRAM TO FIND THE SUM OF INDIVIDUAL DIGITS IN THE GIVEN 'n'

DIGIT DECIMAL NUMBER.

IDENTIFICATION DIVISION.

PROGRAM-ID. PRO.

ENVIRONMENT DIVISION.

DATA DIVISION.

WORKING-STORAGE SECTION.

77 NUM PIC ZZZ9.

77 N PIC 9999.

77 SUM PIC 9(4) VALUE 0.

77 R PIC 9.

77 SUM1 PIC Z(4)9.

PROCEDURE DIVISION.

PARA1.

DISPLAY " ENTER THE NUMBER ".

ACCEPT N.

MOVE N TO NUM.

DISPLAY " ".

DISPLAY " THE NUMBER IS : " NUM.

PERFORM PARA2 UNTIL N = 0.

MOVE SUM TO SUM1.

DISPLAY " ".

DISPLAY " THE SUM OF NUM IS " SUM1.

STOP RUN.

PARA2.

DIVIDE N BY 10 GIVING N REMAINDER R.

COMPUTE SUM = SUM + R.

OUTPUT:

Discuss various forms of get function supported by the Input stream How are they used?

This function is virtually identical to get(buf, num, delim) version of get ( ). The difference between get(buf, num, delim) andgetline ( ) is that getline ( ) reads and removes the delimiter new - line character from the input stream if it is encountered which is not done by the get ( ) function. Following figure explains the difference between get ( ) and getline ( ) functions :

C program to sort all elements of a 4x4 matrix?

This type of sorting can b performd by simply transferring all the matrix elements in a single dimension array of 1X16 size and then sorting this array and then transferring the elements back to 4X4 matrix.

You can also treat the 4x4 matrix as a simple array using pointers and, thus, not need to transfer from matrix to array and back.

Example, using ellipses (...) to simulate indentation for clarity...

int matrix[4][4] = {...some values...}

int *element;

int flag = 1;

while (flag == 1) { /* simple bubble sort */

... flag = 0;

... /* loop from first element to next to last element */

... for (element = &matrix[0][0]; element < &matrix[3][3]; element ++) {

... ... if (*element > *(element + 1)) {

... ... ... flag = 1;

... ... ... *element ^= *(element + 1); /* exclusive or swap */

... ... ... *(element + 1) ^= *element;

... ... ... *element ^= *(element + 1);

... ... }

... }

}

What is a hybrid compiler?

Hybrid compiler is a compiler which translates a human readable source code to an intermediate byte code for later interpretation. So these languages do have both features of a compiler and an interpreter. These types of compilers are commonly known as Just In-time Compilers (JIT).

Java is one good example for these types of compilers.

What are the function of BIR?

The powers and duties of the Bureau of Internal Revenue are:

  • Assessment and collection of all internal revenue taxes, fees and charges; and
  • enforcement of all forfeitures, penalties, and fines connected therewith, including the execution of judgments in all cases decided in its favor by the Court of Tax Appeals and the ordinary courts;
  • It shall also give effect to the administer supervisory and police powers conferred to it by the National Internal Revenue Code and special laws.

What are the advantages and disadvantages of Associative model?

With the Associative model there is not record. When assembling all of the current information on a complex order the data storage needs to be re-visited multiple times. This could pose as a disadvantage. Some calculations seem to suggest that Associative database would need as many as four times the data reads as the relational database.

Trying to delete uninitialized pointer to object?

You cannot delete an uninitialized pointer, because there is no allocation for the object, and the pointer contains garbage. That includes the case where you attempted allocation and failed, but deletion is safe in that case because a NULL pointer is "safe" to delete, even though it does not point at anything.

What are the advantages of a house swap?

There are a lot of advantages of house swapping. First and foremost it is the affordable way to allow families to take much needed vacations while not spending a fortune on accommodations. This is especially true for larger groups. On a simplistic side, one swaps with another family for a specific length of time. This allows families to feel that home-like feeling without breaking the bank.