New User Special Price Expires in

Let's log you in.

Sign in with Facebook


Don't have a StudySoup account? Create one here!


Create a StudySoup account

Be part of our community, it's free to join!

Sign up with Facebook


Create your account
By creating an account you agree to StudySoup's terms and conditions and privacy policy

Already have a StudySoup account? Login here

ENEE 140 (C language) : Arrays

by: Nhi Phan

ENEE 140 (C language) : Arrays ENEE140

Marketplace > Montgomery College > Electrical Engineering > ENEE140 > ENEE 140 C language Arrays
Nhi Phan
Montgomery College
GPA 4.0
View Full Document for 0 Karma

View Full Document


Unlock These Notes for FREE

Enter your email below and we will instantly email you these Notes for Introduction to programming concepts for engineers

(Limited time offer)

Unlock Notes

Already have a StudySoup account? Login here

Unlock FREE Class Notes

Enter your email below to receive Introduction to programming concepts for engineers notes

Everyone needs better class notes. Enter your email and we will send you notes for this class for free.

Unlock FREE notes

About this Document

Helpful definitions & explanations & example
Introduction to programming concepts for engineers
Class Notes
programming for engineers




Popular in Introduction to programming concepts for engineers

Popular in Electrical Engineering

This 3 page Class Notes was uploaded by Nhi Phan on Wednesday April 6, 2016. The Class Notes belongs to ENEE140 at Montgomery College taught by Dr.Lanxiang in Spring 2016. Since its upload, it has received 60 views. For similar materials see Introduction to programming concepts for engineers in Electrical Engineering at Montgomery College.

Similar to ENEE140 at Montgomery College


Reviews for ENEE 140 (C language) : Arrays


Report this Material


What is Karma?


Karma is the currency of StudySoup.

You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!

Date Created: 04/06/16
Lecture 7: Arrays An array variable is a set of variables  share a common name and type  all linked together int x[30]; /* 30 integers */ elements: x[0], x[1], ..., x[29] name of array is x array size: total 30 elements in array ‘x’ it has to be an integer with known value (to determine the memory needed to store the array) each element is int type starts from 0 Array Elements #include <stdio.h> int main( void ) { int i, n[10]; /* n is an array of 10 integers */ for( i = 0; i < 10; i ++ ) { /*loop 10 times*/ n[i]= 2; /* set all elements to 2 */ printf( "n[%d] = %d\n" , i, n[i] ); /*display value of n[i] */ } n[1] = 5; n[3] = n[1] + n[0]; printf( "Enter an integer value: " ); scanf( "%d", &n[5] ); printf( "Element 3 is %d\n", n[3]); /*display element 3 */ printf( "The sixth element is %d\n", n[5]); /*display 6th element*/ return 0; } Example 1: Find the minimum #include <stdio.h> #define SIZE 10 int main( void ) { int i, min, x[SIZE]; for( i = 0; i < SIZE; i ++ ) { /*loop 10 times*/ printf("Enter an integer: "); scanf( "%d", &x[i]); /* read each element */ } min = x[0]; for( i = 1; i < SIZE; i ++ ) { if (x[i] < min) min = x[i]; } printf( "The minimum is %d\n", min); return 0; } Initializing arrays type name[n] = {value0, value1, ... , value(n-1)}; double height[3] = {5.5, 6.3, 5.8}; int x[] = {1, 2, 3, 4, 5}; If all the initial values are given, the number of elements can be omitted. Compiler will count the number of elements and set size of array ‘x’ to 5 Three elements of array ‘height’ are initialized to 5.5, 6.3, and 5.8. Each element is double type. int y[5] = {1, 2}; First two elements y[0] and y[1] are initialized to 1 and 2. Remaining elements [2]-[4] are initialized to zero implicitly.


Buy Material

Are you sure you want to buy this material for

0 Karma

Buy Material

BOOM! Enjoy Your Free Notes!

We've added these Notes to your profile, click here to view them now.


You're already Subscribed!

Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'

Why people love StudySoup

Jim McGreen Ohio University

"Knowing I can count on the Elite Notetaker in my class allows me to focus on what the professor is saying instead of just scribbling notes the whole time and falling behind."

Kyle Maynard Purdue

"When you're taking detailed notes and trying to help everyone else out in the class, it really helps you learn and understand the I made $280 on my first study guide!"

Jim McGreen Ohio University

"Knowing I can count on the Elite Notetaker in my class allows me to focus on what the professor is saying instead of just scribbling notes the whole time and falling behind."

Parker Thompson 500 Startups

"It's a great way for students to improve their educational experience and it seemed like a product that everybody wants, so all the people participating are winning."

Become an Elite Notetaker and start selling your notes online!

Refund Policy


All subscriptions to StudySoup are paid in full at the time of subscribing. To change your credit card information or to cancel your subscription, go to "Edit Settings". All credit card information will be available there. If you should decide to cancel your subscription, it will continue to be valid until the next payment period, as all payments for the current period were made in advance. For special circumstances, please email


StudySoup has more than 1 million course-specific study resources to help students study smarter. If you’re having trouble finding what you’re looking for, our customer support team can help you find what you need! Feel free to contact them here:

Recurring Subscriptions: If you have canceled your recurring subscription on the day of renewal and have not downloaded any documents, you may request a refund by submitting an email to

Satisfaction Guarantee: If you’re not satisfied with your subscription, you can contact us for further help. Contact must be made within 3 business days of your subscription purchase and your refund request will be subject for review.

Please Note: Refunds can never be provided more than 30 days after the initial purchase date regardless of your activity on the site.