Output of the given program

Assignment Help Programming Languages
Reference no: EM13997499

Output of the given program

#include <iostream>
#include <fstream>
#include "mpi.h"

using namespace std;

//g^x = h mod p, find x. ex: 7^x = 15 mod 41, x = 3

main(int argc, char* argv[]) {
int rank;
int size;
int g;
int x;
int h;
int p;
MPI_Init(&argc, &argv);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
MPI_Comm_size(MPI_COMM_WORLD, &size);

if(rank == 0) {
ifstream in;
in.open("num.txt");
in >> g;
in >> h;
in >> p;

ofstream out;
out.open("DL.txt");

for(int i = 0; i < size; i++) {
out << x << endl;
}
}

MPI_Finalize();
}

Attachment:- homework.zip

Reference no: EM13997499

Questions Cloud

Autonomous systems are grouped together on the internet : A routing table can be created and maintained either statically or dynamically. Identify and discuss at least three differences between the static and the dynamic routing environment.
Use minitab to simulate taking a random sample : Use Minitab to simulate taking a random sample of 200 male Angus beef cattle (N(1156,84)). How many of the values do you expect to be less than 1072 or greater than 1240? Why do you expect this number? How many of your values are actually in those in..
Vertical integration is relatively more attractive : Vertical integration is relatively more attractive:
Determine the amount of the impairment loss : Repeat requirement 1 assuming that the fair value of Centerpoint is $270 million.
Output of the given program : Output of the given program - using namespace std - g^x = h mod p, find x. ex: 7^x = 15 mod 41, x = 3
What will be your incentive contract plan-bonus-stock option : Supposed that you represent the shareholder board of Apple Inc. and decide to elicit high CEO effort to help the company: What will be your incentive contract plan (e.g. bonus, stock option…etc.)?
Building blocks of proteins : The Carbon ATOM is bonded to COOH is the Alpha Carbon, so if the AMINE is also attached it is an ALPHA AMINO ACID!!-Entonimers - stereoisomers... mirror images-Body uses L-Form ONlY... Amine residue on LEFT.D-Drugs are NON-EFFECTIVE to use
All the intention of challenging anyone with chemical : A couple questions from my chemistry class. Its an advanced college course and the professor made the questions that follow with all the intention of challenging anyone with chemical and biochemical background. Any help will be greatly appreciated.
Why is spending more on healthcare different : US citizens spend more on iphones/smartphones than the citizens of other countries, yet this type of spending is seldom described as a problem. Why is spending more on healthcare different?

Reviews

Write a Review

Programming Languages Questions & Answers

  Why are most programs still in cobol

Describe the approach and share your thoughts about this new approach to software development.

  Write a program that asks the user to answer some questions

Write a program that asks the user to answer some questions. First, you should ask the user if they want to load answers from a previously saved file. If they respond yes you should look for the file name of your choosing in the path of your choos..

  Find how many words the longest paragraph contains

This def function should search and return the integer that represents this largest length itself. When the passing of (paragraphs) as the argument to this function, it should tell us how many words the longest paragraph contains.

  Web programming

Work through the project instructions using the provided base files. Please note the detailed grading rubric included in the instruction document

  Write application to count number of both odd-even integers

Write application to count number of both odd and even integers of several positive integers. Fisrt value entered specifies number of values to input from user.

  Provide unoptimized-optimized prefix using recursive rule

Where the recursive rule uses concatenation of strings, so F2 is "ab", F3 is "aba". Note that the length of Fn is the nth Fibonacci number. Provide unoptimized and optimized ‘prefix' (fail) function for F7.

  Distinguishing upper and lowercase characters

Distinguishing upper and lowercase charactersDistinguishing upper and lowercase characters

  Write down a program which compute the amounts of money

earl and larry each begin a full-time jobs in january 2013 and plan to retire in january 2061 after working for 48

  Design and write program using functions to calculates area

Design and write a program, using functions, that calculates the area and perimeter of a rectangle whose dimensions (length and width) are provided by a user.

  Pogram to recognize the particular memory location

The 12-bit address recognizes the particular Memory location or I/O device. Illustrate the program execution for following programs.

  Program to calculate monthly gross pay for super supermarket

Owners of Super Supermarket would like to have program which calculates monthly gross pay of their employees. Input for this program is employee ID number, hourly rate of pay.

  Deck of cards programming class

Write a complete program using "ECLIPS" that implements the functionality of a deck of cards. In writing your program, use the provided DeckDriver and Card classes shown below. Write your own Deck class so that it works in conjunction with the two..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd