Write a program that computes the value of the expression: lim(x->inf)(1+1/n)n
between certain values of n and then compare the values with e.
For example, you can compute the values of the expression between:
The program should accept as input:
(Note: The increment value of 100 should be hardcoded in the program upon final submission.)
The program should then output the value of the expression for each value of n in the specified range with a decimal precision of 8.
Bianca is preparing special dishes for her daughter’s birthday.
It takes her a minutes to prepare the first dish, and each following dish takes b minutes longer than the previous dish. She has t minutes to prepare the dishes.
For example, if the first dish takes a = 10 minutes and b = 5, then the second dish will take 15 minutes, the third dish will take 20 minutes, and so on.
If she has 80 minutes to prepare the dishes, then she can prepare four dishes because 10 + 15 + 20 + 25 = 70.
Write a program that prompts the user to enter the values of a, b, and t, and outputs the number of dishes Bianca can prepare.
Suppose you have two arrays: a1[0…n-1] of size n and a2[0….m-1] of size m. Write a program that checks whether a2[] is a subset of a1[] or not. Both the arrays may or may not be sorted. It can be assumed that elements within an array are distinct.
Write a program that inputs a string value from the user and displays it in reverse using pointer.
There is a structure called employee that holds information like employee code, name, date of joining. Write a program to create an array of the structure and enter some data into it. Then ask the user to enter current date. Display the names of those employees whose tenure is 3 or more than 3 years according to the given current date
ask the user to enter the year (can be 1,2,3,) &corce (HNDIT,HNDM,HNDA)
if year is 2&corece is HNDIT show him "it is time to garduate soon"
if year is 2&corece is HNDA show him "it is time to garduwate in 2 years "
if year is 3&corece is HNDM show him "it is time to garduwate soon "
if is 1 show him "you have more time in garduwate"
Given a string, an integer position, and an integer length, all on separate lines, output the substring from that position of that length.
Ex: If the input is:
Fuzzy bear
3
4
the output is:
zy b
Note: Using a pre-defined string function, the solution can be just one line of code.
#include <iostream>
#include <string>
using namespace std;
int main() {
string strVal;
int posStart;
int choiceLen;
string newString;
getline(cin, strVal);
cin >> posStart;
cin >> choiceLen;
cout << newString << endl;
return 0;
}