Ask Question, Ask an Expert


Ask C/C++ Expert

Home >> C/C++

problem1)a) prepare C expressions for each of the following expressions:

i) √x-1/2+y-1/2

ii) (x2+3)/(x-4)-(x-2)/(x3+x-1)

iii) e|xy|sin-1(x/y)

Here x, y are floating point variables.

b) What change is required in the following program so that its output becomes 3, 6, 1, 20, 37,......,1034?

1 # include
2 # include
3 int main ( )
4 {
5 int a = 1, r = 2, i ,
6 for (i = 0; i <=10; i ++)
7 printf (", %d ", a*pow (r, i));
8 return 0;
9 }

problem2)a) prepare a program to find a four digit number such that its value is increased by 75% when its left most digit is removed and is placed after its right most digit.

b) Consider the declaration

int beta[5][5], i, j;

describe what is stored in beta after the following statement execute:

1 for(i = 0; i < 5; i++)
2 for(j =0; j < 5; j++)
3 beta [i][j] = 2*(i + j) % 4;

c) describe the output of following code fragment:

1 int alpha = 5;
2 int beta = 10;
3 i f (beta > = 10)
4 {
5 int alpha = 10;
6 beta = beta + alpha;
7 printf ("%d, %d\n", alpha, beta);
8 }
9 printf ("%d, %d", alpha , beta)

problem3)a) prepare a function which finds the first occurrence of a specific character in a given string. The function should return a pointer to the occurrence in the string or NULL if it is not found. (6)

b) Given the following program segment
1 int j = 2, i;
2 for(i = 0; i <= 5; i ++)
3 {
4 printf ("%4d", j);
5 j = j + 5;
6 }
7 printf ("\n");
prepare a while loop and a do ::: while loop that have the same output.

problem4) a)prepare a function int min ( int, int, int, int) that returns the smallest of four given integers

b) Admission to a professional course is subject to the following conditions

• Marks in Mathematics≥60.

• Marks in Physics ≥ 55.

• Marks in Chemistry ≥ 45


• Total marks in mathematics and physics ≥ 150.

Given the marks in three subjects, prepare a program to process the applications to list the eligible candidates.

c) prepare a program to print the following using for loops only:

  * * * * *
    * * *
   * * *
 * * * * *

C/C++, Programming

  • Category:- C/C++
  • Reference No.:- M92598

Have any Question? 

Related Questions in C/C++

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 ...

Assignment simple 5-card poker gamein this assignment you

Assignment: Simple 5-Card Poker Game In this assignment, you will develop a simple poker game, complete with basic AI, using the object oriented programming principles discussed in class. Flow of Play Your poker game's p ...

This program involves using stl listsfor this program you

This program involves using STL lists. For this program you will implement three functions whose prototypes are given below: list ::iterator mxIter(list ::iterator first, list ::iterator last); void selectSort(list & aLi ...

You need to program a microprocessor that would have a

You need to program a microprocessor that would have a temperature, gas, humidity and PIR sensor connected to it. It would send the data to a PC via a Zigbee and receive commands from the PC via the Zigbee to control mot ...

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 ...

Computer programmingobjectives1 opening a file reading from

Computer Programming Objectives: 1. Opening a file, reading from file, writing to a file and closing a file. 2. Sequential access files handling. 3. Practice C++ programming problems. Note: Carefully read the following i ...

Fix a programthe program is already done and it runs welli

Fix a program The program is already done and it runs well.. I just need someone to fix it for me, the problem happens when you insert invalid day or invalid ticket type, I want you to end the program *at that point* as ...

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 + ...

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 ...

Discussion questonsplease respond to all of the following

Discussion Questons Please respond to all of the following prompts: • How are input and output accomplished in C++? • How do cin and cout relate to ostream and istream? Lab Activity 1. Write a C++ program per the require ...

  • 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