Ask Question, Ask an Expert

+1-415-315-9853

info@mywordsolution.com

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

OR

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

Assignmentoverviewthis assignment consists of implementing

Assignment Overview This assignment consists of implementing an application using the techniques learned in the first half of the course. Examples on how to use file operations, random number generation, the standard tem ...

Assessment taskthis coursework will allow you to

Assessment Task: This coursework will allow you to investigate some of the issues involved in writing threaded programs. You are to write a series of simple programs in C/C++ that will run under Linux, to illustrate how ...

Write a c program that calculates and prints the average of

Write a C program that calculates and prints the average of two or more salaries entered by the user. The program should first prompt the user to enter the number of salaries to process (make sure: at least 2 salaries mu ...

Programming assignment 5write a c program that allows the

PROGRAMMING ASSIGNMENT #5 Write a C program that allows the user to make some banking transactions. The program should first prompt the user to enter the current balance of his/her bank account (in dollars and cents, not ...

Projectdecision statementsdirections read carefully and

Project: Decision Statements Directions (Read CAREFULLY and follow COMPLETELY): - Create the following programs in C++ that perform the purpose described and show the sample output (with user input where applicable). - I ...

1 write a c program that includes a function called lobster

(1) Write a C program that includes a function called lobster() that accepts three arguments: a character and two integers. The character argument is the character to be printed by lobster(). The second argument is the n ...

Design implement test and debug a c program to simulate the

Design, implement, test, and debug a C# program to simulate the rolling of two dice 100 times. Whenever the two dice display the same number, the program should show the roll sequence number (e.g. the 10th roll) and the ...

Assignmentwhen writing c programs include comments in your

Assignment When writing C++ programs include comments in your code, make the program readable by indenting, use meaningful variable and function names, and produce meaningful output. This assignment will be to write a te ...

Programming in c assignmentwrite a c program that computes

Programming in C Assignment Write a C program that computes and outputs the current age of the United States in days (you can use 1776 as theUS founding year). You don't have to worry about fractional years or leap years ...

Assignmentpart acomplete the following questionswrite c

Assignment Part A Complete the following questions: Write C++ code to open a document with the name Hello.txt, place the message "Hello, World!" in the document, and exit the document. Re open the file you closed, and re ...

  • 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

WalMart Identification of theory and critical discussion

Drawing on the prescribed text and/or relevant academic literature, produce a paper which discusses the nature of group

Section onea in an atwood machine suppose two objects of

SECTION ONE (a) In an Atwood Machine, suppose two objects of unequal mass are hung vertically over a frictionless

Part 1you work in hr for a company that operates a factory

Part 1: You work in HR for a company that operates a factory manufacturing fiberglass. There are several hundred empl

Details on advanced accounting paperthis paper is intended

DETAILS ON ADVANCED ACCOUNTING PAPER This paper is intended for students to apply the theoretical knowledge around ac

Create a provider database and related reports and queries

Create a provider database and related reports and queries to capture contact information for potential PC component pro