Tuesday, June 25, 2019

C Program to Reverse Array



For many other Language Programs of microprocessor 8086, C++ ,C , Data Structures visit our  BLOG 

#include<stdio.h>
#include<conio.h>
void main()
{
int n=0 , sum =0 ;
int num[n];
 printf("Enter total times to input number:");
scanf("%d",&n);
 int b=n;
 for(int i=0;i<b;i++) //input aray
{
printf("\nenter numbers to add = \t");
scanf("%d",&num[i]);
}
printf("\n \n the reverse array is:-\n   ");
for(int i=b;i>0;i--)  //reverse array
{
printf("%d",num[i]);
}for(int i=0;i<b;i++)  //sum of array
{
sum=sum+num[i];
}
 printf(" the sum of array is %d",sum);
}



Programs:-

For many other Language Programs of microprocessor 8086, C++ , C, Data Structures visit our  BLOG 

There are programs of Object-Oriented Programing, Operators (logical, arithmethic ,relational,etc) ,exception handeling , inheritance ,string operations ,etc

No comments:

Post a Comment