SophiaPretty

(5)

$14/per page/Negotiable

About SophiaPretty

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Accounting,Algebra See all
Accounting,Algebra,Applied Sciences,Architecture and Design,Art & Design,Biology,Business & Finance,Calculus,Chemistry,Communications,Computer Science,Economics,Engineering,English,Environmental science,Essay writing Hide all
Teaching Since: Jul 2017
Last Sign in: 304 Weeks Ago, 4 Days Ago
Questions Answered: 15833
Tutorials Posted: 15827

Education

  • MBA,PHD, Juris Doctor
    Strayer,Devery,Harvard University
    Mar-1995 - Mar-2002

Experience

  • Manager Planning
    WalMart
    Mar-2001 - Feb-2009

Category > Computer Science Posted 06 Nov 2017 My Price 8.00

need first to point to the first number in the array, last

What am I doing wrong? I need first to point to the first number in the array, last to point to the number after the last number in the array, and then I need to print the numbers. I keep getting the first to print as 0 and last to print as a bunch of numbers. I know there's an easier way to print numbers in an array, this is just part of the assignment

 

#include<stdio.h>

int main()

{

  int array[2];

  int first;

  int last;

  int value;

 

  for(value=0;value<3;value++)

  {

    printf("Enter a number ");

    scanf("%d",(array+value));

  }

  array[0] = first;

  array[2] = (last-1);

 

  printf("nYou entered: n");

  for(value=0;value<3;value++)

  {

    printf("%dn",*(array+value));

  }

  printf("The first number in the array is %dn", first);

  printf("the number after the last number in the array is %dn", last);

 

  return 0;

Answers

(5)
Status NEW Posted 06 Nov 2017 02:11 PM My Price 8.00

-----------  ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly

Not Rated(0)