Write a c++ program to accept a two numbers from the user multiply the two numbers and display the results to the user
Write a program in C++ to print a number entered by the user
Explain the working of the following code perform rough work .
myList *head,*cur,*previous=NULL;
for(int i=0;i<4;i++)
head=new myList;
head->data=0;
head->next=previous;
for(cur=previous;cur!=NULL;cur=cur->next)
head->data+=1+2*cur->data;
previous=head;
while(previous!=NULL)
cout<<previous->data<<endl;
cur=previous;
previous=previous->next;
delete cur;
Write a function in C++ to insert a circular Queue containing
Players information (represented with the help of array of structure PLAYER).
Consider following definition of Node
struct PLAYER
{
int PID;
char Pname[20];
NODE* Next;
};
An array is special, if it contains equal number of even and odd numbers. Create a PROGRAM that print true if an array is special, and false otherwise.
Consider the following statement: int x,y,z, x=3; y=7; z=9; if ( x >y) if ( x-y == 4) z = 33; else z=77; What is the value of z?
Write a C++ program to handle the Input Mismatch Exception.
In the Main method, ask the user for the number of shirts they want to order. Implement try-catch to handle values other than an integer.
Input and Output format:
Refer to sample input and output
[All text in bold corresponds to input and rest corresponds to output]
Sample Input and Output 1:
Enter the number of t-shirts you want to order:
3
Your order for: 3 t-shirts has been successfully placed
Sample Input and Output 2:
Enter the number of t-shirts you want to order:
e
Please enter an Integer only.
Enter the number of t-shirts you want to order:
5
Your order for: 5 t-shirts has been successfully placed
Write a C++ program to get a list of usernames from the user, store it in a set and print the size of the set. Print " Invalid number " if the number of usernames to be added is less than or equal to zero.
In the main method, obtain input from the user in the console and insert the username into the set. Display the size of the set in the main method.
Problem constraints:
Use <set> container to store the values.
Use insert() method to insert the values.
Output format:
The output consists of an integer that corresponds to the size of the set.
If the number of usernames to be added is less than or equal to zero display "Invalid number ".
Output 1:
Enter the number of usernames to be added:
3
Enter the name of user 1
Enter the name:
arjun
Enter the name of user 2
Enter the name:
siva
Enter the name of user 3
Enter the name:
siva
Size of the set is:2
Owner of a Hall
Write a C++ program to find the owner name of the hall by hall number using the map.
In the main method, obtain input as CSV from the user in the console and find the Hall number to get the Owner of that hall using the map.
Problem constraints:
Create a Map as map <string, string >
Use find() to find the hall owner’s name.
Input and Output Format:
The First line of input consists of an Integer 'n' which corresponds to the number of Halls.
The next 'n' lines of Inputs are in CSV format.
For output refer to sample Input and Output for formatting specifications.
Sample Input and Output 1:
Enter the number of Halls
4
Enter details of Hall 1:
Hall-230, Binny
Enter details of Hall 2:
Hall-233, Ram
Enter details of Hall 3:
Hall-255, Annie
Enter details of Hall 4:
Hall-240, Vikram
Enter the Hall number to find its owner:
Hall-233
The owner of Hall-233 is Ram
implement a list data structure including following operations using array adt .
get() update() length() back() next() start() end() remove() add() .
Note: implement above operations only using pointers without using any indexes of arrays.