answersLogoWhite

0

📱

Computer Programming

A category for questions about computer programming and programming languages.

10,506 Questions

Advantages of GUI?

The main advantage of a GUI is that the visual representation of functions allows easier use of the computer compared to a command-line-based interface. It also speeds up the user's work for non-technical people.

How you know if your husband loves you?

its that feeling that you get in the morning that hes the only person that you want to see today and you dream about him all the time day night and in your dreams but all i can really say is you will only know VANESSA RODRIGUEZ

What language should you I learn as a game developer?

I would recommend learning C#, as it is widely used by most game developers.

What are the data types in C language and their meanings?

They are INT , FLOAT , CHAR. int carries integers only & occupies 2bytes of memory space each. float carries fractional numbers only & occupies 4bytes of memory space each.char carries characters only & occupies 1bytes of memory space each.

Hope this will help you.

C program for swap two numbers without using temporary variables?

Using a temporary variable:

#include<stdio.h>

#include<conio.h>

void main()

{

int a,b,temp;

clrscr():

printf("Enter the first number a\n");

scanf("%d",&a);

printf("Enter the second number b\n");

scanf("%d",&b);

printf("Before swapping a=%d b=%d",a,b);

temp=a;

a=b;

b=temp;

printf("The swapped values are: a=%d b=%d",a,b);

getch();

}

Without using a temporary variable:

#include<stdio.h>

#include<conio.h>

void main()

{

int a,b;

clrscr();

printf("Enter the first number a\n");

scanf("%d",&a);

printf("Enter the second number b\n");

scanf("%d",&b);

printf("Before swapping a=%d b=%d",a,b);

a=a+b;

b=a-b;

a=a-b;

printf("The swapped values are: a=%d b=%d\n");

getch();

}

Print the digits in a number in ascending or descending order c program?

#include


/* In case pow does not work from math.h */
int my_pow( int x, int y )
{
int i, result = 1;


for( i=1; i<=y; i++ )
{
result = result * x;
}


return result;
}


int main()
{
int n,i,j, temp1, temp2;


printf("\n Enter number of digits :");
scanf("%d",&n);


for( i= my_pow(10,n-1); i < (my_pow(10,n)-1); i++ )
{
j = n;


do
{
temp1 = ( i / (my_pow(10,(n-j))) ); /* Formula to fetch successive digit */
temp1 = temp1%10;


temp2 = ( i / (my_pow(10, (n-(j-1)))) ); /* Formula to fetch successive digit */
temp2 = temp2%10;


if ( temp1 > temp2 )
{
if ( 1 == j )
{
printf(" %d, ", i );
break;
}


j--;
}
else
{
break;
}


}while(1);
}


printf("\n");


return 1;


}


OUTPUT:


------------


[~/temp-satish]$ ./a.out


Enter number of digits :2
12, 13, 14, 15, 16, 17, 18, 19, 23, 24, 25, 26, 27, 28, 29, 34, 35, 36, 37, 38, 39, 45, 46, 47, 48, 49, 56, 57, 58, 59, 67, 68, 69, 78, 79, 89,
[~/temp-satish]$
[~/temp-satish]$ ./a.out


Enter number of digits :3
123, 124, 125, 126, 127, 128, 129, 134, 135, 136, 137, 138, 139, 145, 146, 147, 148, 149, 156, 157, 158, 159, 167, 168, 169, 178, 179, 189, 234, 235, 236, 237, 238, 239, 245, 246, 247, 248, 249, 256, 257, 258, 259, 267, 268, 269, 278, 279, 289, 345, 346, 347, 348, 349, 356, 357, 358, 359, 367, 368, 369, 378, 379, 389, 456, 457, 458, 459, 467, 468, 469, 478, 479, 489, 567, 568, 569, 578, 579, 589, 678, 679, 689, 789,
[~/temp-satish]$ ./a.out


Enter number of digits :4
1234, 1235, 1236, 1237, 1238, 1239, 1245, 1246, 1247, 1248, 1249, 1256, 1257, 1258, 1259, 1267, 1268, 1269, 1278, 1279, 1289, 1345, 1346, 1347, 1348, 1349, 1356, 1357, 1358, 1359, 1367, 1368, 1369, 1378, 1379, 1389, 1456, 1457, 1458, 1459, 1467, 1468, 1469, 1478, 1479, 1489, 1567, 1568, 1569, 1578, 1579, 1589, 1678, 1679, 1689, 1789, 2345, 2346, 2347, 2348, 2349, 2356, 2357, 2358, 2359, 2367, 2368, 2369, 2378, 2379, 2389, 2456, 2457, 2458, 2459, 2467, 2468, 2469, 2478, 2479, 2489, 2567, 2568, 2569, 2578, 2579, 2589, 2678, 2679, 2689, 2789, 3456, 3457, 3458, 3459, 3467, 3468, 3469, 3478, 3479, 3489, 3567, 3568, 3569, 3578, 3579, 3589, 3678, 3679, 3689, 3789, 4567, 4568, 4569, 4578, 4579, 4589, 4678, 4679, 4689, 4789, 5678, 5679, 5689, 5789, 6789,
[~/temp-satish]$

How do you draw very well?

Practice makes perfect! However, there are some special tricks, and you can find a book full of them at your public library. Some of those tricks are like using a certain type of pencil, drawing lightly in some areas, and other things like that.

What is the difference between a string and a number?

In computer programming, a "string" usually refers to an array of characters. A string may consist of nothing (an empty string) or as many characters as are allowed in an array. To denote a string, surrounding a list of characters by double quotes is the typical standard.

Strings:

* "" * "abc" * "Cows say 'Moo!'" * "http://wiki.answers.com"

Numbers are those fun symbols you remember from math class. The confusing part is when a string contains numbers ("123"). Usually a programming language will have a way to convert between a string of numbers and an actual number type, in case you happen to need to do math with the string.

What is sequential programming language?

In the early days of computing, the dominant programming languages weresequential(such as basic or assembly language). A program consisted of a sequence of instructions, which were executed one after the other. It ran from start to finish on a single processor.

reference: http://code.google.com/edu/parallel/mapreduce-tutorial.html

What does acronym Ajax stand for?

AJAX is shorthand for Asynchronous JavaScript and XML (Extensible markup language). Ajax allows continued interaction with the server while not requiring a page to be manually refreshed to display new data.

What are the vertical rows called on the periodic table?

The vertical rows on the periodic table are called groups.
The vertical rows are called periods and the horizontal columns are called groups.

Difference between Object Oriented Analysis and Object Oriented Design?

Structured Analysis treats processes and data as separate components versus object-oriented analysis combines data and the process that act on the data into objects. http://www.dbar-innovations.com

What is primary device?

Ooh..., tough one. You could say it is the user. But that is lame. You could also say processor, since no computer could work without one. My first computer worked with a 5¼" floppy drive, no hard drive, 256 kb of RAM and a 4.7 Mhz processor. No mouse either. The graphics were CGA and EGA.

What do you mean by compiler assembler and interpreter?

Computers can directly run only binary machine code. When people write programs, that program text must be processed into machine code before it can be run.

Compilers and assemblers convert the source code into machine code. Compilers take a high-level language such as C or C++ and convert it, while assemblers take a much lower level language called "assembly language" where there is one language statement per machine instruction. High-level languages can be recompiled for different kinds of processors (like Intel or ARM CPUs) but assembly language is closely tied to the kind of processor. Some compilers actually compile high-level code into assembly language and then run that through an assembler to get machine code.

Interpreters are a different animal. They take either source code or partially compiled code and run it in the interpreter itself, rather than creating machine code. In other words, they directly "interpret" the program. Languages such as Perl, Python, and Ruby are interpreted from the source code. For Java and C#, the source code is compiled into an intermediate code that is easy to interpret.

What are the purpose of compilers?

When writing a program, you write it in a certain language (java, C++, VB.NET etc.).

For the computer to understand that, you need to convert it to computer language.

That is what the compiler does.

What is the maximum number of nodes on a given level of a binary tree?

Level N of a binary tree has, at most, 2^N nodes. Note that the root node is regarded as being level 0. If we regard it as being level 1, then level N would have 2^(N-1) nodes at most.

How do you download c plus plus on vista?

You cannot download a programming language, but you can download compilers. Check the attached link.

Write assembly language to add two decimal number?

name "str2bin"

; convert string number to binary!

; this program written in 8086 assembly language to

; convert string value to binary form.

; this example is copied with major modifications

; from macro "scan_num" taken from c:\emu8086\inc\emu8086.inc

;

; the original "scan_num" not only converts the string number

; but also reads the string from the keyboard and supports

; backspace key, this example is a shorten version

; of original "scan_num" macro.

; here we assume that the string number is already given,

; and the string number does not contain non-digit chars

; and it cannot cause buffer overflow (number is in word range

; and/or has only 4 digits).

; negative values are allowed in this example.

; the original "scan_num" does not allow to enter non-digits

; and it also checks for buffer overflow.

; you can the original file with other macro definitions

; in c:\emu8086\inc\emu8086.inc

org 100h

jmp start

; text data:

msg1 db 0Dh,0Ah, " enter any number from -32768 to 65535 inclusive, or zero to stop: $"

msg2 db 0Dh,0Ah, " binary form: $"

; buffer for int 21h/0ah

; fist byte is buffer size,

; second byte is number of chars actually read (set by int 21h/0ah).

buffer db 7,?, 5 dup (0), 0, 0

; for result:

binary dw ?

start:

; print welcome message:

mov dx, offset msg1