answersLogoWhite

0

#include<iostream>

#include<random>

int main()

{

std::default_random_engine generator;

std::uniform_int_distribution<int> distribution (1,9);

std::cout << "Array : ";

int a[10];

int* p = a;

do {

std:: cout << (*p = distribution (generator)) << '+';

} while (++p != a + 10);

int sum = 0;

p = a;

while (p != a + 10)

sum += *p++;

std::cout << "\b=" << sum << std::endl;

}

User Avatar

Wiki User

10y ago

What else can I help you with?

Related Questions

How do you write c program to perform sum of elements of matrix using pointers with functions?

i cant write


What is the assembly program to generate a geometric series and compute its sum The inputs are the base root and the length of the series The outputs are the series elements and their sum?

What is the assembly program to generate a geometric series and compute its sum The inputs are the base root and the length of the series The outputs are the series elements and their sum?


Different types of elements which require storage during program execution?

Variables, arrays, objects, and pointers are common elements that require storage during program execution. Each of these elements holds data that needs to be accessed or modified during the running of the program.


How to write a C program to find largest 2 numbers using pointers?

program to find maximum of two numbers using pointers


How pointers reduce the length of a program?

They don't.


Sample program for far pointers?

#include&lt;stdio.h)


What is the verb for computer?

The verb for computer is compute.Other verbs are computes, computing and computed."I am computing"."We have computed the program""I like to compute".


Write a program to illustrate the usage of pointers with arrarys and functions?

* * * * * * * * * * write the c++ program and show me brifily?


What will be the program to arrange numbers stored in array in ascending order using pointers?

sorry


Write a c program to copy two strings using pointers?

nahi malum


Write a pascal program that compute an area of a triangle?

{A program to compute the area of a triangle} {by Ogboin W. Meshach} Var; b,h:real; BEGIN Writeln('Triangle'); Write('Base: '); Readln(base); Write('Height: '); Readln(height); area:=0.5*base*height; Writeln('Area: ', area :0:2); End.


Write a c program to find Volume and surface area of cube?

Write a c program to compute the surface area and volume of a cube