Ask Question, Ask an Expert


Ask C/C++ Expert

Home >> C/C++

a) Convert the expression 4-5/6+(2/3-8)}/8*3 to RPN.

b) What is the output of the following program? describe step by step the procedure.

Int row=5,column;
printf("%s",row%2 ? "<" : ">");
} --row;

Instead of using nested while loops, if you want to use nested for loops, what changes are required in the above program so that the output remains same ?

c) prepare a program using switch statement which takes two integers and an operator from the keyboard. If the operator entered through the keyboard is any one of the operators { + ,-, * ,/ }, then the program performs the operation and print the result. If the operator entered is other than the mentioned above, the program prints the string “Operation cannot be performed”. Your program should also take care of the division by 0.

problem4) Assume the following declarations

Int a[5] ={1,2,3,4,5};
Int *ptr_a,*ptr=NULL;
Int number ,i;

Find errors in the following statements if any and do the necessary corrections.

i) ++ptr_a;

ii) number=ptr_a;

iii) number=*ptr_a[2];

iv) for(i=0;i<=5;i++)

v) number=*ptr;

c) Define a function isprime ( ) which takes a positive integer and returns 1 if the number is prime and 0 otherwise. Use this function to define another function called num_of_primes ( ) which takes  two natural numbers p and q(where p < q) and returns the number of primes between them.

d) Define a macro to find the minimum of two numbers. Using this define a function minimum ( ) which takes four numbers as parameters and returns the minimum.

e) Arrange the following operators in ascending order of priority. Tell associativity for the operators who have same priority.

                     <   *   >  ||  []   +=  !=     +      ++

problem5) a) prepare a function with the following prototype int delete_elements (int *list[ ], int last_index, int p, int q) which deletes all the elements of a list from index p to q (where p < q ) and returns the last_index of the updated list . Also prepare the main function to test your function.

b) prepare statements to accomplish each of the following. Assume the structure

struct person


char lastName[10];

char firstName[10];

int Age;


has been defined and that the file is already open for writing.

i) Initialize the file “personaldata.dat” so that there are 100 records with lastName=“ ”, firstName =“ ” and Age = 0.

ii) Input 10 last names, first names and ages and prepare them to the file.

C/C++, Programming

  • Category:- C/C++
  • Reference No.:- M92586
  • Price:- $60

Priced at Now at $60, Verified Solution

Have any Question? 

Related Questions in C/C++

Computer programming assignment-q1 using for loop write a c

Computer Programming Assignment- Q1. Using for loop, write a C++ program that prints out the multiples of 3 up through 75, separated by a blank space.  3 6 9 12 15 18 21 24 27 30 33 36 39 42 45 48 51 54 57 60 63 66 69 72 ...

Computer scienceprogram-write a c program that willpresent

Computer Science Program- Write a C++ program that will: Present the user with a menu of choices: 1. Random number 2. String 3. Type Casting 4. Integer Math Then, in an if-else if structure (or switch) write the code for ...

Descriptionnbspin this assignment you will write a c

Description:  In this assignment you will write a C++ program that finds the kth largest number among a set of N numbers. It will implement the solution using two different algorithms and measure the time elapsed during ...


Write a C++ program that will use loops to perform each of the following tasks: 1. Ask the user for two characters from the keyboard and read them into char variables. Determine which input is larger and which is smaller ...

Write code to create the generator submit your source code

Write code to create the generator. Submit your source code as well as a description of how I could run the program, sample screenshots of the program in action, and the various changes that could be produced through you ...

Q 1 write a c program to declare two integer one float

Q. 1 Write a C++ program to declare two integer , one float variables and assign 10, 15, and 12.6 to them respectively. It then prints these values on the screen. Q. 2 Write a C++ program to prompt the user to input her/ ...

Objectives- gain experience with if if else and switch

Objectives - Gain experience with if, if else, and switch statements in C programs. - Experience using % operator and true false logic. Hints This program will be MUCH easier if you design how to do the logic in your own ...

Problem 1overview for problem 1a of this assignment you

Problem #1 Overview: For problem 1(a) of this assignment, you will need a C++ compiler. In order to receive credit, your program must compile and run; and you must provide the actual source code file so that I can compil ...

Please use codeblockslist the program and the output on the

Please use codeblocks List the program and the output on the command line Eg #include #include using namespace std; int main() { floatjohno = 0.5; size_t size = 24; vector array(size); for(inti=0; i     { johno = johno + ...

Ipo chartinputprocessingoutputmarks for four

IPO Chart Input Processing Output Marks for four courses Processing Item: Grade Point and Grade for individual course Overall GPA Algoritham Initialize gp with zero Repeat  for (each course)                 Enter the mar ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

A cola-dispensing machine is set to dispense 9 ounces of

A cola-dispensing machine is set to dispense 9 ounces of cola per cup, with a standard deviation of 1.0 ounce. The manuf

What is marketingbullwhat is marketing think back to your

What is Marketing? • "What is marketing"? Think back to your impressions before you started this class versus how you

Question -your client david smith runs a small it

QUESTION - Your client, David Smith runs a small IT consulting business specialising in computer software and techno

Inspection of a random sample of 22 aircraft showed that 15

Inspection of a random sample of 22 aircraft showed that 15 needed repairs to fix a wiring problem that might compromise

Effective hrmquestionhow can an effective hrm system help

Effective HRM Question How can an effective HRM system help facilitate the achievement of an organization's strate