answersLogoWhite

0

📱

Computer Programming

A category for questions about computer programming and programming languages.

10,506 Questions

What is the term to mention the processing speed of computer?

There are several terms used to mention the processing speed of a computer, the closest being Instructions per second or IPS. Typically expressed in terms of millions, MIPS.

However, MIPS is not adequate enough as to be used as standard comparison of systems.

What is the difference between reports and queries?

query takes a table and given the criteria entered into it it displays the results that meet that search. While a report just spits out a table in the database

Bzero function in socket programming?

bzero: writes the specified number of null bytes to the specified destination.
bzero(char *dest, int nbytes);

How to declare near and far pointers in C?

It used to be a good question 30 years ago.

Right know you don't have to know anything about near and far pointers; but if you still use a 16-bit compiler, select 'Large Model' (or 'Huge Model'), and forget 'near' and 'far'

What are conditional connectives. Explain with an example?

What are conditional connectives? Explain use of conditional connectives with an example

Write a function that will scan a character string passed as an argument and convert all lowercase letters onto uppercase letters?

/* Write a function that will scan a character string passed as an argument & convert all lowercase characters into their uppercase characters*/

#include<stdio.h>

#include<conio.h>

#include<string.h>

#include<ctype.h>

int str_upp(char c[])

{

int i;

char x;

printf("\n \n");

for(i=0;i<strlen(c);i++)

{

x=toupper(c[i]);

printf("%c",x);

}

return (0);

}

void main()

{

char c[10];

clrscr();

printf("Enter string : \n");

scanf("%s",c);

str_upp(c) ;

getch();

}

/*

Output:

Enter string :

Heloo

HELOO

*/

What is relationship between type definition and union and enum?

There is no relationship other than that they are programming concepts. they each serve a different purpose.

Type Definition

A type definition is an alias; an alternate name for a type that already exists. Type definition help to make code easier to read. For instance, instead of using the type "unsigned long long int", we can alias it:

typedef unsigned long long int UINT;

Now we can use the UINT type wherever we would normally have used "unsigned long long int".

Union

A union is a type with two or more members of different types that all have the same start address. The length of a union is determined by the longest member of the union. Unions are useful when you have a variety of data types but do not need to maintain separate values for those types; only one member can be active at any one time. As an example, consider the following:

union pointer {

int* pint;

char* pchar;

};

Here we can assign the memory address of an integer to pint and then read back the first byte of that integer using pchar:

int i=0x12345678;

pointer x;

x.pint = &i;

std::cout<<"Integer: "<<*x.pint<

std::cout<<"Byte: "<<*x.pchar<

The output will be:

Integer: 305419896

Byte: 120

Unions are best avoided as they are often used to provide type-casts that are inherently unsafe.

Enum

An enum is an enumeration. When you define an enumeration you define a type for which some values of that type have names. Those names are constant members of the enum.

enum traffic_light {red, amber, green};

If a type is not specified, the type defaults to an int. Given that there are only three values in this enum, a char would suffice:

enum traffic_light : char {red, amber, green};

Enums are useful in that they allow a related set of constants to be grouped.

If no values are specified, the constants are valued according to the order in which they are declared. Thus the above is equivalent to:

enum traffic_light : char {red=0, amber=1, green=2};

If you assign any value to an enum member, all subsequent members are numbered in sequence:

enum traffic_light : char {red=1, amber, green};

The above is therefore equivalent to:

enum traffic_light : char {red=1, amber=2, green=3};

Enum members can also be given the same value if desired:

enum traffic_light : char {red=1, amber=2, yellow=2, green=3};

Using enums help eliminate coding errors:

void f (traffic_light colour) {/*...*/}

f (red); // ok

f (green); // ok

f (4); // error: 4 is not a member of traffic_light!

Enums are also useful for naming bits:

enum bit {

bit_0 = 1<<0, // = 0x01 = 00000001

bit_1 = 1<<1, // = 0x02 = 00000010

bit_2 = 1<<2, // = 0x04 = 00000100

bit_3 = 1<<3, // = 0x08 = 00001000

bit_4 = 1<<4, // = 0x10 = 00010000

bit_5 = 1<<5, // = 0x20 = 00100000

bit_6 = 1<<6, // = 0x40 = 01000000

bit_7 = 1<<7 // = 0x80 = 10000000

};

void f (bit b)

{

if (b & bit_1)

{

// bit_1 is set in b

}

else

{

// bit_1 is not set in b

}

if (b & (bit_1 | bit_2))

{

// bit_1 and/or bit_2 is set

}

else

{

// neither bit_1 nor bit_2 are set

}

}

Can Asus P8Z77-V Pro hold 16GB memory?

Hey, I forgot to mention that the whole information is that it is a:

ASUS P8Z77-V Pro LGA1155 Z77 DDR3 SLI 3PCI-E16 2PCI-E1 2PCI SATA3 DisplayPort USB3.0 Motherboard

and I wanted to know if I could add

Corsair CML16GX3M4A1600C9B Vengeance Low Profile Blue 16GB 4X4GB DDR3-1600 CL9-9-9-24 Memory Kit

Is it possible to use or do I need smaller GB or an extension Thanks

If an array has a 100 elements what is the allowable range of subscripts?

Since arrays in C are zero based, the allowed subscript range is 0 - 99 (gives 100 values). Always remember to subtract 1 from the high range (in this case 100) to get the last subscript maximum value.

How does the bellman ford algorithm work?

This distance-vector algorithm works by computing the shortest path , and considers weights. The algorithm was distributed widely in the RIP protocol.

When might you omit a break statement from the end of a case in a switchstatement?

You can omit the break statement at the end of a case whenever you want execution to flow into the next case, or when the case is the last case.

For instance, if you wanted to test a character regardless of whether it was upper or lower case, you might use the following:

void f(char c)

{

switch (c)

{

case 'a': // execution flows into next case...

case 'A':

// do something

break;

case 'b': // execution flows into next case...

case 'B':

// do something else

}

}

How does a trend help people connect with others?

I would think that it gives different people a common interest that they can then use to connect.

How many bytes of ram are in 4 MB?

1024 bytes in 1 KB,

1024 kilobyes in 1 MB

1024 x4 = 4KB x 1024 =

4194304 bytes in 1 MB. (About 4.2 million)

Stack can be described as a pointer Explain?

Stack is also dynamic memory, without the hassle. Dynamic memory uses pointers to check its value, free the memory, etc.

What do you mean by sequential execution?

Sequential or "top-down" programming means, simply, you code is executed in predictable order; from the top to the bottom of the source code. Typically, void of any functions.

How does knowledge of programming concepts benefit individuals working in almost any IT position?

It does because if you are working in IT company then the thing which matters is: "How can you save the efforts of other people(Customors) so that they will reward you" You can do this only if you automate the process which individual have to perform manually.This can be done by programming only.

What problems do UPS's information systems solve?

UPS information system provides solution for different categories of customers.

Individuals Customers

i) Easy Access to Shipping and Tracking

ii) Everything You Need to Ship and Track, Online

iii) Receive Packages Your Way

iv) Access UPS When and Where You Need To

v) Get Your UPS Bill Faster vi)Returns Made Simple

Business Clients

i) Save Time and Money

ii) Manage Shipping Online

iii) Receive Packages at Your Convenience

iv) Access UPS Where and When You Need To

v) Get Paid Faster

vi)View and Pay Your Invoice

vii) Excess resources like call center and others.

Shipping and Receiving Managers

ii) Leverage UPS Technology to Manage Shipping and Returns

iii) Take Control of Your Receiving Process

v) Access UPS When and Where You Need To

vi) Receive Your Invoice Electronically From UPS

What is the subnetmask for 194.117.4.211.?

194.117.0.0 .

Because it is a class C IP address.

What is race around condition?

The "Race Around Condition" occurs when J+K=1 i.e. When the FF is in the toggle mode.
the race around condition in JK latch can be avoided by:
a) Using the edge triggered JK flip flop.
b) Using the master slave JK flip flop.

What is memory protection?

The protection of memory allocated to one program from unauthorized access by another program is called memory protection. It may refer to protection among various programs in a multi tasking environment or in between OS and a program in a single tasking environment. It is needed to prevent a bug within a process from affecting other processes. It also prevents system crash in case of error on OS.

What is difference between C and lisp?

If i know the answer i better open face book rather than this...