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

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

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