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

Object-oriented programming assignmentintroduction -nbspa

Object-Oriented Programming Assignment Introduction -  "A logical matrix or (0, 1) matrix is a matrix with entries from the Boolean domain B = {0, 1}. Such a matrix can be used to represent a binary relation between a pa ...

Assignmentthis is the programthis program will use 2

Assignment This is the program: This program will use 2 different data structures to perform the same tasks; a vector and a dynamically sized array Write a complete C++ program that will: Declare a vector of integers wit ...

Programming in cbubba tubs bbq rub is a company that makes

Programming in C++ Bubba Tub's BBQ Rub is a company that makes different BBQ dry rubs and sauces. They make each product when it is ordered with the freshest ingredients and sell it by the unit. A unit is 2 ounces of pro ...

Assignmentgoals developing problem-solving skills declaring

Assignment Goals: Developing problem-solving skills, declaring variables, multi-way branches, data validation. Problem: Complete Programming Challenge 4.19 in your text book. Do not accept values larger than 10 meters or ...

Intro to programming in c assignmentsince this is the last

Intro to Programming in C Assignment Since this is the last assignment, there will be no late submission. All programs must be electronically submitted by 5:00pm on Tuesday, December 2nd with NO EXCEPTIONS in order to re ...

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

Discussionkeyboard versus file input please respond to the

Discussion "Keyboard versus File Input" Please respond to the following: • Suppose you are designing a C++ application that needs to capture user input specifically via a keyboard or from a file. Determine the method tha ...

Write a c application that does the followingitem 1 prompts

Write a C++ application that does the following: ITEM 1: Prompts the user to choose one of the following series: 1 + 1/2 + 1/3 + ... + 1/n ((((x * 2) * 2) * ...) * 2) series of n multiplications x + (x * 1) + (x * 2) + ( ...

Discussionwhile loops versus for loops please respond to

Discussion "While Loops versus For Loops" Please respond to the following: • Suppose you are writing a C++ program that plays a commercial video continuously within a kiosk at your favorite shopping mall within your home ...

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

  • 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