how can i make program using arrays related to my course civil engineering?
answer please?

Recommended Answers

All 4 Replies

#include<stdio.h>
#include<conio.h>
main()
{     int odd[10];

      printf("\nEnter Ten Numbers: ");

      for(int ctr1=0; ctr1<=9; ctr1++)
      { scanf("%d", &odd[ctr1]); }

      printf("ODD NUMBERS: ");

      for(int ctr2=0; ctr2<=9; ctr2++)
      { if(odd[ctr2]%2!=0)
        { printf("%d ", odd[ctr2]); } }

      getch(); }
#include<stdio.h>
#include<conio.h>
main()
{
      int num[10];

      printf("\nEnter Ten Numbers: ");

      for(int ctr1=0; ctr1<=9; ctr1++)
      { scanf("%d", &num[ctr1]); }

      printf("ORDERED NUMBERS: ");

      for(int ctr2=0; ctr2<=8; ctr2++)
      { for(int ctr3=ctr2+1; ctr3<=9; ctr3++)
        { if(num[ctr2] > num[ctr3])
          { int temp=num[ctr2];
            num[ctr2]=num[ctr3];
            num[ctr3]=temp; } } }

      for(int ctr4=0; ctr4<=9; ctr4++)
      { printf("%d ", num[ctr4]); }

      getch();
      }
#include<stdio.h>
#include<conio.h>
main()
{
      int num[20];
      printf("\nEnter Twenty Numbers: ");
      for(int ctr1=0; ctr1<=19; ctr1++)
      {
              scanf("%d", &num[ctr1]);
      }
      printf("POSITIVE NUMBERS: ");
        for(int ctr2=0; ctr2<=19; ctr2++)
      {
                if(num[ctr2] >= 0)
        {
                printf("%d ", num[ctr2]);
                }
                }
      printf("\nNEGATIVE NUMBERS: ");

      for(int ctr3=0; ctr3<=19; ctr3++)
      {if(num[ctr3] < 0)
       {printf("%d ", num[ctr3]);
       }}
          getch(); 
      }

how can i make program using arrays related to my course civil engineering?
answer please?

Please, use code tags when you post. It makes it easier to read. Also, in your programming, the language you are using is C, not C++. You also are using main incorrect. you want to declare main as such

int main(){
...
}

Now what exactly is your issue that you are attempting to do? Your Op is vague.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.