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

C projectphase 11- you need to take input from user study

C project Phase 1 1- You need to take input from user study year (proper value check from 1 to 4) 2- Take input semester (proper value check 1 to 8) 3- Calculate GPA (use Loop, calculate GPA for semester 1,2,3...) Exampl ...

Computer applications divisionassignment c programmingstl

COMPUTER APPLICATIONS DIVISION Assignment: C++ PROGRAMMING STL Vector For this assignment, you will be starting with an example program that demonstrates the use of a STL vector. In addition to this, you may need to look ...

Assignmentobjectivespractice reading characters from a

Assignment Objectives Practice reading characters from a file Practice using command line input Practice using command-line redirection of files Practice implementing a double transposition ciphering algorithm Summary In ...

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

Writing a c code its a beginner level code design a class

Writing a C++ code, its a beginner level code. Design a class house that defines a house on a street. A house has a house number and an (x,y) location, where x and y are numbers between -10 and 10. the key member is plot ...

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

Write a c program that prompts the user to enter a line of

Write a C program that prompts the user to enter a line of text (up to 50 characters). It should then convert the text entered to uppercase letters and then to lowercase letters, and then to Sentence case. Your program s ...

Write a c program that requests the name of any cartoon

Write a C program that requests the name of any cartoon character from the user, then does the following with that name (use printf for each): a. Displays it enclosed in double quotes. b. Displays it in a field 24 charac ...

Computer sciencewhere do you think c and coding games in c

Computer Science Where do you think C++ and coding games in C++ is headed in the next five years? How about in the next 10 years? Do you think there are any significant improvements that need to be made to the code to en ...

Bankers algorithmimplement the bankers algorithm for

Banker's Algorithm Implement the Banker's algorithm for deadlock avoidance, that works on a given set of N processes and M resource types (N The input data and result is then displayed on the screen. You may use your pro ...

  • 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

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

Describe what you learned about the impact of economic

Describe what you learned about the impact of economic, social, and demographic trends affecting the US labor environmen