Ask Question - Get Answer

1 Ans A C program to input and display an Array

Asked by AL MaMun (4 Golds) Friday, 31 Jul 2020, 04:11 PM at (Education Tutorials)

Please log in to answer, like and save
0
Save 0

<<< Previous
Log in to Answer Next >>>

Answer(s):

C program to input and display a C array.


#include<stdio.h>

int main()

{

    int arr[100], i, n, j;

    printf("Enter N\n");

    scanf("%d", &n);

    printf("Enter numbers in the array: \n");

    for(i=0; i<n; i++)

    {

        scanf("%d", &arr[i]);

    }

    for(j=0; j<n; j++)

    {

        for(i=j+1; i<n; i++)

        {

            printf("{%d,%d},", arr[j], arr[i]);

        }

    }

    return 0;

}


Answered by AL MaMun (4 Golds) Friday, 31 Jul 2020, 04:11 PM

Please log in to Upvote, Downvote and Report
           

Related Q/A:

1 Ans Write a C program to print Fibonacci number series

1 Ans Write a C program to implement x power n using recursion

2 Ans Write a C program to implement Selection sort data structure and algorithm

1 Ans How to Learn HTML - HyperText Markup Language easily? 

1 Ans Write a C++ program for BigMod math

1 Ans Write a C program to implement Insertion sort data structure and algorithm

2 Ans Train Location Message TR Train_Code and Send to 16318 Example: TR 705 Send to 16318

1 Ans Single Digit Interest Rate in the Banking Sector: Problems and Prospects - essay writing

1 Ans The general rules for constructing names for variables (unique identifiers)

2 Ans BPSC Programming Aptitude Lab Test Important programs