When float used and when int used in C programming?
if your calculation involves a decimal point, u must use float, otherwise you can use integer for normal purpose.
for example,
if u want to divide some number, lets say 9/4 then u must use float to get the answer in accurate decimal point , otherwise if u use int there, the answer will be just 2 instead of 2.25
whenever we used an integer in the program we used int. if there is any decimal part in the number then we used float.
How much does a programming language generally cost?
Many programming languages, such as Java, are completely free to use, and being one of the major players in the programming language wars, as well as being cross-platform, in addition to being easy to learn, and in addition to it being free, many choose Java for their first language.
Another question: your question makes no sense: you cannot buy or sell programming languages.
What is a program written in high level language called?
the program written in high level language is called "source program"
What does it mean to be in the loop?
If somebody was to be out of the loop, they would be lacking critical information or popular knowledge. Now if somebody was IN the loop, this would mean you are up to date on the latest topics of your "loop".
What is the main functions of HRM?
There are seven main functions of HR . They are : Function 1: Manpower planning Function 2: Recruitment and selection of employees Function 3: Employee motivation Function 4:Employee evaluation: Function 5:Organizational relations Function 6: Provision of employee services Function 7: Employee education, training and development Functions and Activities of HRM
In order to achieve the objectives of an organisation, the HRM section or department must carry out a number of functions. The key functions of HRM can be summarized as the acquisition, maintenance, development and termination of employees.
Acquisition: This is the 'getting' phase of HRM. It includes estimating both the future demand and supply for human resources and integrating these resources into a total human resource strategy. In other words, the objectives and future directions of the organisation must be known before any reliable forecasts of people needs can be made. The acquiring process includes recruiting, selection and the socialization or induction of new employees.
Maintenance This is the 'keeping' function and involves providing benefits, services and working conditions that are needed if individuals are to remain committed to the workplace.
Which bitwise operator is suitable for turning off a perticular bit in a number?
AND, or to be more precise: OR
C program for polynomial multiplication?
/*==========================================
calculation of product of two matrix........
written by kr.gauraw
==========================================*/
#include<stdio.h>
#include<conio.h>
void main()
{
int mat1[3][3],mat2[3][3],mat3[3][3],i,j,k,sum;
clrscr();
printf("\nEnter values for 1st 3 x 3 matrix:\n");
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
scanf("%d",&mat1[i][j]);
}
}
printf("\nEnter values for 2nd 3 x 3 matrix:\n");
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
scanf("%d",&mat2[i][j]);
}
}
printf("\nThe 1st matrix you entered is :\n");
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
printf("%d\t",mat1[i][j]);
}
printf("\n");
}
printf("\nThe 2nd matrix you entered is:\n");
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
printf("%d\t",mat2[i][j]);
}
printf("\n");
}
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
sum=0;
for(k=0;k<3;k++)
{
sum=sum+mat1[i][k]*mat2[k][i];
}
mat3[i][j]=sum;
}
}
printf("\nThe product of two above matrix is:\n");
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
printf("%d\t",mat3[i][j]);
}
printf("\n");
}
printf("\n\n\nPress any key to exit.....");
getch();
}
What are the applications of parallel processing?
In a nut shell. The most common applications of parallel computing/processing are solving extremly complex problems whithin the science and engineering communities e.g. ... grid computing and internet technology.
Is machine language is also called a assembly language?
Computers only understand machine code. Low-level Assembler language and all high-level languages must be assembled or compiled to machine code in order to execute. However, the computer itself can be programmed (with a machine-code program) to generate the required machine code from either a low-level or high-level input. Low-level Assembler is an almost one-to-one translation of symbols and mnemonics to machine code whereas high-level languages often compile to object code which is then linked to produce machine code.
Interpreted high-level languages are not compiled to machine code but are interpreted by another program, an interpreter, which translates each line of high-level code into the required machine code at runtime. Java, for instance, compiles to byte code suitable for the Java virtual machine. The JVM is a machine code program that interprets the byte code to produce machine-specific machine code. As a result of this interpretation, Java programs are much slower than machine-coded implementations of the same program.
Write a C program to check a string is a palindrome or not?
cls
input "enter a string=";s$
l=len(s$)
for i = l to 1 step-1
c$=mid$(s$,i,l)
next i
r$=c$+r$
if r$=c$ then
print "no. is palindrome"
else
print "no. is not palindrome"
endif
end
Give an example of an abstract data type?
some common adt's which prived useful in agreat variety of applications are container, deque ,list, map, multimap ,multiset , queue ,setstack, string, tree
"another answer"
"if we declare an integer value in c++, int x, we can say that the name attribute has value(x) and that the type attribute has value(int x=4) the value of attribute has value four.
What is the advantages of structure in c language?
A C++ structure (struct) is simply a type of class where all members have public access by default (class members are private by default). Aside from that, C++ classes and structures have exactly the same meaning; the following definitions are exactly equivalent:
struct S {
int x; // public by default
private:
int y;
};
class C { public:
int x;
private:
int y;
};
Note that although the physical representations of S and C types are exactly equivalent, they are still fundamentally different types. That is, you cannot pass an object of type C into a function that expects an object of type S, unless you explicitly define a cast operator to perform an implicit conversion from C to S.
By convention you will typically use structures to define PODs ('plain old data' types where all members are implicitly public and the type is not itself derived from another non-POD type) and use classes when you need to establish an invariant. However, there's nothing in the language that fundamentally prevents you from using a structure to establish an invariant or to use a class as a POD. The only real disadvantage in doing so is that (conventional) C++ programmers may question why you would choose to do so; it can only lead to confusion.
Passing parameters probably means passing a parameter into a function.Basically, this happens when you call a function.
You put the parameter into a function, then call it, and the function does something to the parameters you put into it.
Here's an example:
#include <iostream>
using namespace std;
int sum(int a, int b); //Declare the function, so the program knows that it exists
int main() {
int first, second, total;
cout<<"Please insert two numbers."<<endl;
cin>>first>>second;
total=sum(first, second); /*Here we are passing the variables (parameters) "first" and "second" into the function "sum". This function then does something to them and outputs the value. In this case, it is stored in the variable "total"*/
cout<<"Their sum is "<<total<<"."<<endl;
return 0;
}
//Here we define the function (tell the program what to do)
int sum(int a, int b) { //We pass two integers into the function. Their values are stored in a and b. a and b can then be used by the function.
sum=a+b;
return sum;//Adds them, then returns the sum
}
The binary number 00110110 is the decimal number?
The first digit is worth 20 (or 1), the second 21 (or 2), the third 22 (or 4), the fourth 23 (or 8), the fifth 24 (or 16), the sixth 25 (or 32) and so on. 001100 is thus 0x1 + 0x2 + 1x4 + 1x8 + 0x16 + 0x32 = 4 + 8 = 12
Boot frozen means that whenever a PC restarts, it will be reverted to a pre-defined state. In other words, if you start you start a boot frozen PC, then delete some files, then the next time you restart the PC, the files will be back.
Boot thawed simply means that the PC is not boot frozen.
What is the difference between looping and recursion?
Both Iteration and Recursion run a part of an algorithm repeatedly. We typically use them when, in a part of an algorithm, we have to do or calculate something (i,e. the logic remains the same though the data changes) for a certain number of times. However,in Recursion, we simply run a loop for a certain number of times in the algorithm, such as printing a statement ten times is recursion. In Iteration, we specifically run a loop, such that, the second run of the loop makes use of the computation/result from the first run, the third run (or iteration) makes use of the result from the second run and so on. Hence, in Iteration, the n th run of the loop makes use of the result from the n-1 th run. Consider the following example for calculating the summation, which we will denote as sum(n), meaning n + n-1 + n-2 + n-3 + ... + 2 + 1 + 0. Hence, sum(5) = 5+4+3+2+1+0 = 15. Now we will write psuedo-code to calculate the sum(n) using Iteration and Recursion. Iterative Version:- ----------------- start sum(n) { i = 0; total = 0; do while i is not greater than n, { total = total + i; i = i + 1; } return total; } Recursive Version:- ----------------- start sum(n) { if n is equal to 0, then return(0); otherwise, return (n + sum(n - 1)); } Notice that the Iterative version calculates the sum by repeatedly accumulating the sum in the variable total. In contrast, the recursive version simply repeatedly calls itself, each time with a decremented value.
.
Where does the main function starts and end in c program?
The entry point of a C program is the main function.
The function signature might be like one of these:
1. int main (void)
2. int main (int argc, char *argv[])
Datatypes what r types of datatypes?
short int
int
long int
double
float
char
these are all datatypes
What are theApplications of stack in data structure?
1. Expression evaluation and syntax parsing
Calculators employing reverse Polish Notation use a stack structure to hold values. Expressions can be represented in prefix, post fix or infix notations. Conversion from one form of the expression to another form may be accomplished using a stack. Many compilers use a stack for parsing the syntax of expressions, program blocks etc. before translating into low level code. Most of the programming languages are context-free languages allowing them to be parsed with stack based machines.
2. Runtime memory management
A number of programming languages are stack oriented , meaning they define most basic operations (adding two numbers, printing a character) as taking their arguments from the stack, and placing any return values back on the stack. For example, Post Script has a return stack and an operand stack, and also has a graphics state stack and a dictionary stack.
3. SecuritySome computing environments use stacks in ways that may make them vulnerable to security breaches and attacks. Programmers working in such environments must take special care to avoid the pitfalls of these implementations.
How do you write an algorithm for fibonic number?
In a Fibonacci sequence, the previous two numbers are added to generate the next Fibonacci number.
F1=1st number
F2=2nd number
F3=f1+f2=1+2=3
F4=f2+f3=2+3=5
F5=f3+f4=3+5=8, and so on.
f1 f2 f3 f4 f5 f6 f7..............
1 2 3 5 8 13 21.............
In algorithm:
1. Assign sum=0, A=0, B=1, i=1
2. Get the no. of terms upto which u want to generate the Fibonacci no, i.e., n.
3.Add A and B to get the next Fibonacci number
4. Assign the value of B to A i.e. A=B
5. Assign the value of sum to B i.e. B=sum
6. Write the value of su to get next Fibonacci number in the series.
7. increment i with 1 i.e. i=i+1 and repeat step 3,4,5,6 with the last value of i=n(n is the no. of terms which u wnt to generate Fibonacci no. series.)
8. Stop
Is cin a function or object in c?
cin is an object........ An Example is // By Codex
#include <iostream> using namespace std; int main(){ int age;
cout << "How Old Are You?\n";
cin >> age;
cout << "You are << age << years old\n";
system("pause")
return 0;
}
What are the data types use in c plus plus?
Binary data is intrinsically numeric, therefore every type (including user-defined types) can be represented as a number. Even an executable or a file is nothing more than an extremely large number, in binary, made up of a specific sequence of bits grouped in various ways (bytes, words, dwords, etc), each of which is a number in its own right.
What these numbers actually represent is purely a matter of interpretation. While a char type is typically used to represent an alphanumeric character or symbol, it is really just a character code (a number in the range 0 to 255) that can be mapped to a symbolic character in the ASCII character set. A char is therefore no different to a byte and can represent an actual number just as easily as it can a character.
The primitive types are: unsigned short int, short int, unsigned long int, long int, int, unsigned int, char, wchar_t, bool, float, double and long double, each of which is intrinsically numeric. All user-defined types, including classes and structures, are derived from some combination of these primitive types.
What language is used for robot programming?
A bot can be written in a server-side language like php, asp, etc.
How do you implement queue using singly linked list?
Queues are a first in first out structure (FIFO). This means all extractions occur at the head of the list and all insertions occur at the tail. This requires that you maintain pointers to the head and tail node to allow constant time insertion and extraction of nodes. The nodes themselves are singly linked, each pointing to the next node. The tail node always points to NULL until a new node is insert, which the tail points to. The new node then becomes the tail. When extracting a head node, its next node (which may be NULL if it is also the last node) becomes the new head of the list. If the head is NULL, the tail is also set to NULL.