Skip to main content

How To Input Values Into Array

How To Input Values Into Array

#include<stdio.h>
#include<conio.h>
int main()
{
int i,a[5];
printf("enter the 5 values");
for(i=0;i<5;i++)
{
scanf("%d",&a[i]);
}
printf("5 values is");
for(i=0;i<5;i++)
{
scanf("%d",a[i]);
}
getch();
}






Comments

Popular posts from this blog

C++ Program Finding The Absolute Value

#include<iostream> using namespace std; int main() { cout<<" enter any number"; cin>>num; if(num>0) { cout<<"The absolute value of number is:"<< num; } else { cout<<"The absolute value of number is :"<< -(num); } return 0; } OUTPUT Enter Any number: 2 The absolute value of number is 2