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 check a Prime number

1 Ans Write a C program to check Bubble sort data structure and algorithm

1 Ans Bank Exam all important Writing Materials

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

1 Ans Write a C program to find the highest and lowest number in a series

1 Ans Write a C program for Interest Calculation

3 Ans Three ways to find Greatest Common Divisor (GCD) and Least Common Multiple (LCM) in a C program

3 Ans BPSC Assistant Programmer Lab Aptitude test Programs and Queries with Proper solution (Taken By BCC)

1 Ans Write a C program to reverse a number

1 Ans Best Web development site in the internet ?