answersLogoWhite

0

📱

Computer Programming

A category for questions about computer programming and programming languages.

10,506 Questions

Write a program to find prime number in vb net?

Private Sub Command1_Click() Dim I, N As Integer N = Val(Text1.Text) For I = 2 To N - 1 If N Mod I = 0 Then Print "THE NUMBER IS NOT A PRIME NUMBER" Exit Sub End If Next I Print "THE NUMBER IS A PRIME NUMBER" End Sub Private Sub Command2_Click() Text1.Text = "" Text1.SetFocus End Sub Private Sub Command3_Click() End End Sub

What does visit frequently mean?

Visit most of the time. Mabe like 2-4 times a week.

What is style of function is not obsolete in c language?

Old:

function (par1, par2)

int par1;

char *par2;

{...}

New:

int function (int par1, char *par2)

{...}

How do you write a computer program to arrange numbers in ascending order?

#include

int main()
{
int num[100];
printf("please input your numbers.enter any letter for the end\n");
int i=0,j=0,k=0;
while(scanf("%d",&num[i++]));
i--;
printf("you input %d numbers\n",i);
for(j=i-1;j>=0;j--){
for(k=0;k<=j;k++){
if(num[k]>num[k+1]){
int temp;
temp=num[k+1];
num[k+1]=num[k];
num[k]=temp;
}
}
}
for(j=0;j<=i-1;j++){
if(j%5)
printf("%d ",num[j]);
else{
printf("\n");
printf("%d ",num[j]);
}
}
return 0;
}

5 Why Searching is slower in Linked-List than in Trees?

Searching is slower for linked-lists rather than (ordered) trees because you need to iterate through each element serially, whereas for an ordered (binary) tree you use a "divide and conquer", otherwise known as binary search, method.

Think of it this way. Think of a number between 1 and 128. Perhaps the number is 97. With an ordered list, it would take 97 comparisons to find the item. With an unordered list, it would take an average of 64 comparisons - if the order was random. With a binary tree, i.e. a binary search, you only need 7 comparisons. In fact, you never need more than 7 comparisions for a tree size of 128, and on average, you would use less than that.

Where is the memory allocated?

Cache memory is built into the central processing unit, commonly known in short as the CPU, or it can be located on a separate chip next to the CPU.

In other sense, cache is located between CPU and Main Memory in the memory hierarchy of a computer system.

just type allinurl:cache memory, in Google search and you will find your answer with more pictures and a lot more about cache memory.

What is cximagecrt dll?

cximagecrt.dll is a cximage belonging to cximage from Pizzolato Davide Non-system processes like cximagecrt.dll originate from software you installed on your system. As most applications store data in your system's registry, it is likely that your registry has suffered fragmentation and accumulated harmful errors.

What is the difference between instruction and microinstruction?

In a microprogrammed processor, the hardware

doesn't directly execute the instructions in the

ISA

 The hardware executes very simple micro-operations that

are used to implement the instructions

 Each instruction specifies a sequence of micro-operations

that are used to implement the instructions

Why you are mark a class protected for inheritance?

Public, Private and Protected "keywards/ access modifiers" are used similarly as they are with variables. Protected variables, methods or class CAN ONLY be used by an inherited class.

What is the definition of immersive?

Answer

The term immersive refers to the impression that someone has of being somewhere while, in reality, he is physically in another place.

/kl/kl/kl/l/lkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkm;o;ho;i;l,;,,

What are the codes for a batch file?

Well to make a batch file you would go on your desktop, make a text document, then write the code in it:

@echo off

title New(whatever your topic is)

color f(you can change the letter for a different color)

echo New(what the message says)

pause

start firefox.exe "www.google.com"(opens up firefox, you can take this out if you would like.)

exit

so a brand new one would be

@echo off

title

color

echo

pause

start

exit

but when you make the text document be sure to save it as (whatever).bat

Where are global variables tored?

In a segment of memory, whose name is 'data segment'

One instruction in high level language corresponds to one instruction in machine language?

No. Generally, one instruction in a high level language corresponds to many instructions in machine language.

What complications are imposed if one tries to implement a dynamic list using a traditional homogeneous array?

in dynamic list after adding a new element size of the list disturbed so deletion and insertation is necessary to add a new element

Explain the four basic data type in C. What is the size in byte of each type in DOS and UNIX platforms?

1. 'Explain' is not a question, but here you are:

unsigned char: a number between 0 and 255

signed char: a number between -128 and 127

unsigned short: a number between 0 and 65535

signed short: a number between -32768 and 32767

2. sizeof (type) will tell you

Shell program to generate prime number between 1 and 50?

There are several shell programs available for download on the Internet that will generate prime numbers. The best way to find a prime number is through calculation, however.

What is Binary sequence for 32 through 63?

32 decimal is 0x20 and 63 is 0x3f, thus the sequence is: 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f

Can a folder contain other folders?

Yes. You simply make a folder, then open it, then right click, then left click "New", then left click "Folder." Done. That easy. Or if you have an old one button mouse click on your folder and click new---> new folder.

Advantages of multiple inheritance in UML?

dvantages of multiple inheritances:
· Multiple inheritance allows a class to inherit the functionality of more than one base class thus allowing for modeling of complex relationships


· You categorize classes in many ways. Multiple inheritance is a way of showing our natural tendency to organize the world. During analysis, for example, we use multiple inheritance to capture the way users classify objects.


· By having multiple super-classes, your subclass has more opportunities to reuse the inherited attributes and operations of the super-classes.


Disadvantages of multiple inheritances:
· Some programming languages (such as Java) do not allow you to use multiple inheritances. You must translate multiple inheritance into single inheritance or individual java interfaces. This can be confusing and difficult to maintain because the implemented code for categorizing objects is quite different fro the way the user organizes those objects. So, when the user changes their mind or adds another category, it is difficult to figure out how to program the new sub classes.


· The more super classes your sub class inherits from the more maintenance you are likely to perform. If one of the super classes happens to change, the sub class may have to change as well.


· When a single sub class inherits the same attribute or operation form different super classes, you must choose exactly which one it must use.


Multiple inheritances can cause a lot of confusion, say when both the classes from which you want the child class to inherit from, has a method with same


Muhammad Shahbaz


Linux Administrator




Other Responses:


The Eiffel language and method was designed from the ground up to have multiple inheritance without ANY of the `gotchas' of languages like Java, C++ and others. The `disadvantages' listed above have nothing to do with MI, but with the technique and technologies listed (e.g. Java or C++). When MI is designed thoughtfully into a language and method, then the `dangers' or `disadvantages' are not there. As an Eiffel engineer, we use MI extensively, safely and beneficially all the time.