Skip to main content

Posts

Implementation of Artificial Intelligent

Artificial Intelligent successfully been used and using in: Finance Robotics Games Medicines The Web and many more..

What exactly Artificial Intelligence or AI is?

Artificial intelligence or AI  is the intelligence of machines, any kind of machines that is programmable. And it is called AI program. Now another topics come here, that is "What is AI or Artificial Intelligence program is?" Yes, AI program is called Intelligent Agent.  Do you know what is Intelligent Agent? An intelligent agent is a system that perceives its environment and takes actions that maximize its chances of success. I will discuss more about intelligent agent in my next post. Stay with me. Thank You.

C++ Code of Bubble Sort

Bubble sort, often incorrectly referred to as sinking sort, is a simple sorting algorithm that works by repeatedly stepping through the list to be sorted, comparing each pair of adjacent items and swapping them if they are in the wrong order. Here is the C++ implantation of Bubble sort #include <iostream> using namespace std; int main() { int i,j, n; cout<< "How much number you will sort?" << endl; cin>>n; int a[n]; for(int x=1; x<=n;x++) { cout<< "Enter "<< " Number " << x <<": " << endl; cin>>a[x]; } for(int i=1; i<=n;i++) for(int j=i+1; j<=n;j++) { if (a[i]>a[j]){ int temp; temp = a[i]; a[i]=a[j]; a[j]=temp; } } cout<< "Sorted numbers are:" << endl; for(int x=1; x<=n;x++) { cout<< a[x] << ...

Integer Numbers in Programming Language

An integer variable may be defined to be of type short , int , or long . The only difference is that an int uses more or at least the same number of bytes as a short , and a long uses more or at least the same number of bytes as an int . For example, on the author’s PC, a short uses 2 bytes, an int also 2 bytes, and a long 4 bytes. short age = 20; int salary = 65000; long price = 4500000; By default, an integer variable is assumed to be signed (i.e., have a signed representation so that it can assume positive as well as negative values). However, an integer can be defined to be unsigned by using the keyword unsigned in its definition. The keyword signed is also allowed but is redundant. unsigned short age = 20; unsigned int salary = 65000; unsigned long price = 4500000; A literal integer (e.g., 1984 ) is always assumed to be of type int , unless it has an L or l suffix, in which case it is treated as a long . Also, a literal integer can be specified to be...

Memory, Memory Address in Programming Language

A computer provides a Random Access Memory (RAM) for storing executable program code as well as the data the program manipulates. This memory can be thought of as a contiguous sequence of bits , each of which is capable of storing a binary digit (0 or 1). Typically, the memory is also divided into groups of 8 consecutive bits (called bytes ). The bytes are sequentially addressed. Therefore each byte can be uniquely identified by its address. Figure: Bits and bytes in memory. The C++ compiler generates executable code which maps data entities to memory locations. For example, the variable definition int salary = 65000; causes the compiler to allocate a few bytes to represent salary . The exact number of bytes allocated and the method used for the binary representation of the integer depends on the specific C++ implementation, but let us say two bytes encoded as a 2’s complement integer. The compiler uses the address of the first byte at which salary is alloca...

Comments in Programming Language

A comment is a piece of descriptive text which explains some aspect of a program. Program comments are totally ignored by the compiler and are only intended for human readers. C++ provides two types of comment delimiters: · Anything after // (until the end of the line on which it appears) is considered a comment. · Anything enclosed by the pair /* and */ is considered a comment. Comments should be used to enhance (not to hinder) the readability of a program. The following two points, in particular, should be noted: · A comment should be easier to read and understand than the code which it tries to explain. A confusing or unnecessarily-complex comment is worse han no comment at all. · Over-use of comments can lead to even less readability. A program which contains so much comment that you can hardly see the code can by no means be considered readable. · Use of descriptive names for variables and other entities in a program, and proper indentation of ...

Variables In Programming Language

A variable is a symbolic name for a memory location in which data can be stored and subsequently recalled. Variables are used for holding data values so that they can be utilized in various computations in a program. All variables have two important attributes: · A type which is established when the variable is defined (e.g., integer, real, character). Once defined, the type of a C++ variable cannot be changed. · A value which can be changed by assigning a new value to the variable. The kind of values a variable can assume depends on its type. For example, an integer variable can only take integer values (e.g., 2, 100, -12).