Logo 
Search:

C Programming Articles

Submit Article
Home » Articles » C Programming » Homework HelpRSS Feeds

Program to display array values using for loop

Posted By: Adalgisal Fischer     Category: C Programming     Views: 4653

Write a program to display array values using for loop.

Code for Program to display array values using for loop in C Programming

#include <stdio.h>
main()
{
int a[5];    \\A
for(int i = 0;i<5;i++)
{
a[i]=i;    \\B
}
printarr(a);    
}
void printarr(int a[])
{
for(int i = 0;i<5;i++)
{
printf("value in array %d\n",a[i]);
}
}
  
Share: 


Didn't find what you were looking for? Find more on Program to display array values using for loop Or get search suggestion and latest updates.

Adalgisal Fischer
Adalgisal Fischer author of Program to display array values using for loop is from Frankfurt, Germany.
 
View All Articles

 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!