Write a program that continues to ask the user to enter any decimal number and calculate it’s binary,octal and hexadecimal equivalent.
Write a program that takes an integer and displays the words number of that value. For example, 10->ten 121->one hundred twenty one
Write a program to display all possible permutations of a given input string--if the string contains duplicate characters, you may have multiple repeated results. Here is a sample for the input cat cat,cta,act,atc,tac,tca
How can I write a program that convert a given number of millimeters into the equivalent length in meters and meters into the equivalent length in millimeters?Also draw flowchart,algorithm,output.
Why C++ does not have virtual constructors?
when we write a function virtual, a virtual table is created and to point to that virtual table we need virtual pointers so as we have not created the pointers for the constructor we cant make the con...
since we know that name of constructor and name of class is always same . and in c++ the name of class always unique, so the concept of overriding can not be apply on constructor.
Why does 'float' accept 'int' but not 'char'?
Float variable can hold both of the variables either char or int.
There is nothing wrong in this coding because character c will accept the value a and due to swapping the floar k will accept the ASCII code of the letter a which is 97.......So the value of k is 97.
C coding question on running time program
/*assume contents are sorted*/public static intbinarysearch(int x,int a[]){int low=0; 0(1)int high=a.Length-1; 0(1)int mid; 0(1)while(low>x;while(x!=99){n++; 0(1)sum+=x; 0( n/x)cin>>x;}mean - sum/n;what is the running time?Please help me understand it. The websites are not that helpful to me. Please....
This seems to be a question about time complexity / big-O notation. Time complexity basically tells you how the program running time scales, as a function of one of the variables of input (in most cas...
What is dead code? Explain in programmatic way?
Hi Dead code (a.k.a Unreachable code),as the name suggests is the portion of the code which is never executed. Point out the word NEVER , as the code above that made the break before that and the exec...
dead code is such a collection of lines of code or code which executes but it its result does not have any significance or affect on output.
What is the datatype of pointer?
There is no single "pointer" data type; you have many pointer data types. A pointer to int may have a different size and representation from a pointer to char, which may have a different size and rep...
Pointer datatypes are actually the datatype of the variables whose address the pointer is going to store or point to.
What is the size of an empty class?
what is the output for the below example?
Code
#include iostream using namespace std; class A { }; int main() { coutsizeof(A)endl; system(pause); return 0; }?
class A{
}
most of time sizeof(A) = 1, however, it is a small integer regarding to the complier.
I'm having some trouble trying to program these problems and putting them into the main function. Please help me by giving some advice or website that offer good information for me.1. Write a function that accepts a string of characters from a user and displays the string one word per line.2. Write a...
Do you agree or not that "object oriented programming basic paradigms like abstraction, encapsulation, aggregation, composition, inheritance, polymorphism, templates etc are based and works in a same way as human thinks and behave in our daily life? Justify your answer with very precise and to the point...
What is function linkage mechanism? Can inline function be used at run time? Why or why not?
What is the context of one and two after the following frsgment of code is executed?Vector one(7, string("one"));vector two(one.Begin() + 2, one.End()-3);
Diff betweeen static and local
In the below prog,node * q is local to a function add() but it acts as static .How?#includeusing namespace std;class ll{public: struct node{ int data; node *link; }*p;ll(){p=null;}int add(int x){ node *q,*r;if(p==null){ r=new node; r->data=x; r->link=null;q=r; p=q;}else{r=new node;r->data=x;r->link=null;q->link=r;q=q->link;}return...
In the below program ,in function add() node * q is local but it acts as static ie I mean it works correctly how is it possible?#includeusing namespace std;class ll{public: struct node{ int data; node *link; }*p;ll(){p=null;}int add(int x){ node *q,*r;if(p==null){ r=new node; r->data=x; ...
What is the disadvantage of using too many templates?
It may reduce programs readability.
How can we access priVATe members of classs?
What is static polymorphism? Give its syntax and simple example.
I hope you know the concept of polymorphism.
Compile time polymorphism is called static polymorphism.
Ex. overloading and overriding member functions. But they should not be virtual functions.
By using dangling pointer we can access the values at the deallocated memory here, in the below code the memory allocated for variable n will be dealloeated as and when the control transfers from func...
Dangling pointers arise when an object is deleted or deallocated, without modifying the value of the pointer, so that the pointer still points to the memory location of the deallocated memory.