write an application that asks the user to enter two integers obtains them from the user in java
Program that accepts an input as a decimal number and converts it into a binary expression?
if you're using Java the Integer class has alot of methods that can easely convert to byte
for example:
int s;
Integer i = new Integer (s);
i.byteValue() // returns the same number but as a byte
i.toBinaryString(s) // returns the binary value as a string varibale
otherwise you can construct a loop that constructs a varaible using isOdd and finction ex :
public int binaryVariable (int i){
int m = 1; // increments with each variables
int n = 0; // varies between 0 and 1;
int a =0; // the outcoming number;
while (i>0){
if (isOdd (i)) n =1; // I'm afraid you have to make the isOdd function
else n = 0;
a +=n*m;
m*=10;
i/=2;
}
return a;
}
//hope this has helped
Is possible. It means hexadecimal, so 0x33 = 3*16 + 3 = 51
Differences between user define function and uild in?
The person who created them.
For example, you don't have to write an 'sprintf'function, because you already have it in the standard libraries.
What do you mean by constant in c language?
Constant in C means the content whose value does not change at the time of execution of a program.There are several types of constants $ they are i>numeric->a.INTEGER b.REAL
ii>character->a.SINGLE CHARACTER b.STRING.
Hope this will help you.
In c plus plus 5.02 how many memory cells are required to store a single character?
1 byte.. (1 cell)
Recursive function in c to compute the number of nodes in a binary tree?
int Nodes (Tree *t)
{
int sum= 0;
if (t) {
sum+=1;
if (t->left) sum += Nodes (t->left);
if (t->right) sum += Nodes (t->right);
}
return sum;
}
What are the different types of integer constants in c language?
Well, uh, const unsigned int and const signed int..
Difference between argc and argv?
I really hope you pay more attention to your texts and lessons in the future, anyway:
int argc (Argument Count, note that it is an integer.)
char* argv[] (Argument Value, the actual thing stored there.)
Those are passed to the main function from the operating system so that you can have command line parameters.
Oh and if you really want me to blow your mind, they don't need to be name argc/argv.
int main(int argc, char* argv[])
{
for(a=0;a<=argc;a++){
printf(%s,argv[a]);
}
return 0;
}
is the same as
int main (int foo, char* bar[])
{
for(a=0;a<=foo;a++){
printf(%s,bar[a])
}
return 0;
}
(Which means the prototype for main is usually: int main(int, char**) )
Write an algorithm to search an element in linked list?
To search for an element in a linked list, you iterate the list, looking for the element, and either return the element or an indication that it was not found. for (ptr = first; ptr != null; ptr = ptr.next) if (ptr.value == searchvalue) break; This will either leave ptr with the address of the found element, or null, if not found.
What is the difference between C plus plus and the D language?
D essentially evolved from practical usage of C++ and added features found in other languages including C#, Eiffel, Java, Python and Ruby. D has garbage collection, design by contract, unit testing, true modules, first class arrays, associative arrays, dynamic arrays, array slicing, nested functions, inner classes, closures, anonymous functions, compile time function execution, lazy evaluation, a re-engineered template syntax and integrated inline assembler.
What is an ordered list of data structure using c plus plus?
An ordered list of data in any programming language is simply a sorted array or list. In C++ this can either mean a sorted array, vector, list or forward list.
Why use of external variables is discouraged?
External variables, or global variables, are generally frowned upon because any code with access to the variables can alter the variables in unexpected ways. Object oriented programming addresses this problem by allowing programmers to encapsulate those variables into an object (often a singleton object) which provides far greater control over how those variables may be altered.
What is an evaluation purpose only program?
I means that you are not supposed to use it for any other purpose except for deciding if the program will do what you want.
It is like test driving a car.
Structures can be defined as a tool for handling a group of logically related data items. They are user-defined and provide a method for packing together data of different types.
Structure Student
'declaring a structure named Student
Dim StudentId As Integer
Dim StudentName As String
'declaring two fields of different data types in the structure
End Structure
Best Regards
Nikhil Soni
What has the author N C Meachem written?
N. C. Meachem has written:
'List of old houses in the parish of Erdington'
What is conversion function how it is created explain its syntax?
A conversion function is a function that converts data from one type to another. A conversion function has one argument of the type being converted from while the return type is the type being converted to. If required, additional arguments may be used to refine the conversion. Conversion functions are required to provide conversions between types that cannot be handled by a built-in cast.
char* itoa(int value, char* str, int base);
This non-standard function is an example of a conversion function, converting a built-in integer type to a null-terminated ASCII string representing the integer's value in a given base. The return value is simply the string pointed to by the strargument.
When would you use bubble sort?
Never. Bubble sort is often cited as an example of how not to write a sorting algorithm and is used purely as a programming exercise. It is never used in production code.
Although reasonably efficient when sorting small lists, an insertion sort performs better on average. But for larger lists it has no practical uses. A merge sort is better for large lists, but if stability isn't an issue a quick sort is even better. Hybrid sorts typically use quick sort until a partition is small enough for an insertion sort to complete the job.