Thread: Print first element of array without using index

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Feb 2020
    Posts
    2

    Print first element of array without using index

    Hi everyone. I have to print array in this order 5,10,.., 30 (this isn't the problem using for loop), but after that i have to print first number, but when i print i, the result is the last number that came from last iteration in loop. I havent learn arrays, so the solution with indexes is not an option.
    Output should be like this: 5 10 15 20 25 30 5
    Last edited by Andrijana; 02-10-2020 at 03:32 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Print the array element error in program
    By vead in forum C Programming
    Replies: 4
    Last Post: 01-06-2018, 06:11 PM
  2. Insert element after the last element in array in c
    By amaturequestion in forum C Programming
    Replies: 3
    Last Post: 04-09-2015, 08:29 AM
  3. Replies: 8
    Last Post: 04-04-2012, 09:03 PM
  4. how to print/access the 1st element of the first set of the vector
    By kapil1089thekin in forum C++ Programming
    Replies: 1
    Last Post: 08-11-2010, 02:28 PM
  5. get the largest element from the array and print it
    By casperghost in forum C Programming
    Replies: 2
    Last Post: 12-27-2009, 06:22 PM

Tags for this Thread