Click here to Skip to main content
14,666,988 members
Home » Discussions » ATL / WTL / STL
   

ATL / WTL / STL

 
QuestionTo take input for n number of arrays and print it. Pin
Tarun Jha10-Dec-17 4:55
MemberTarun Jha10-Dec-17 4:55 
AnswerRe: To take input for n number of arrays and print it. Pin
Richard MacCutchan10-Dec-17 5:49
mveRichard MacCutchan10-Dec-17 5:49 
GeneralRe: To take input for n number of arrays and print it. Pin
Tarun Jha10-Dec-17 6:11
MemberTarun Jha10-Dec-17 6:11 
GeneralRe: To take input for n number of arrays and print it. Pin
Richard MacCutchan10-Dec-17 6:18
mveRichard MacCutchan10-Dec-17 6:18 
GeneralRe: To take input for n number of arrays and print it. Pin
Tarun Jha10-Dec-17 6:48
MemberTarun Jha10-Dec-17 6:48 
GeneralRe: To take input for n number of arrays and print it. Pin
Richard MacCutchan10-Dec-17 6:52
mveRichard MacCutchan10-Dec-17 6:52 
GeneralRe: To take input for n number of arrays and print it. Pin
Tarun Jha10-Dec-17 7:19
MemberTarun Jha10-Dec-17 7:19 
AnswerRe: To take input for n number of arrays and print it. Pin
Member 1332249811-Dec-17 8:55
MemberMember 1332249811-Dec-17 8:55 
#include <stdio.h>

void array(int arr[], int i, int size)
{
	for (int j = 0; j<size; j++)
	{
		printf("\nEnter arr[%d][%d]: \t",i, j);
		scanf("%d", &arr[j]);
	}
}


int main()
{
	int num, size[100];
	int i, j;
	int arr[100][100];

	printf("Enter the number of arrays: \t");
	scanf("%d", &num);
	num = num < 100 ? num: 100;
	//feeding elements.
	for (i = 0; i<num; i++)
	{
		printf("\nEnter the size of the array: \t");
		scanf("%d", &size[i]);

		printf("\nEnter the array: ");
		//int arr[i][size[i+1]];
		size[i] = size[i] < 100 ? size[i] : 100;
		array(&arr[i][0], i, size[i]);
	}

	for (i = 0; i<num; i++)
	{
		printf("\n");
		for (j = 0; j<size[i]; j++)
		{
			printf("%d\t", arr[i][j]);
		}
	}
	printf("\nPress Enter key to exit.\n");
	getchar();

	return 0;
}


modified 11-Dec-17 15:28pm.

GeneralRe: To take input for n number of arrays and print it. Pin
Tarun Jha11-Dec-17 10:56
MemberTarun Jha11-Dec-17 10:56 
GeneralRe: To take input for n number of arrays and print it. Pin
Tarun Jha16-Dec-17 5:41
MemberTarun Jha16-Dec-17 5:41 
QuestionHow do I keyboard input in OpenGL Pin
Mr. Anup Roy1-Dec-17 3:57
professionalMr. Anup Roy1-Dec-17 3:57 
QuestionHow to get cpu speed and ram manufaturer C Languae? Pin
Uzair Ahmad12-Nov-17 4:56
MemberUzair Ahmad12-Nov-17 4:56 
AnswerRe: How to get cpu speed and ram manufaturer C Languae? Pin
Afzaal Ahmad Zeeshan1-Dec-17 4:32
mvaAfzaal Ahmad Zeeshan1-Dec-17 4:32 
QuestionHow to Disable open drop down Pin
yaswanthdasari24-Oct-17 21:36
Memberyaswanthdasari24-Oct-17 21:36 
SuggestionRe: How to Disable open drop down Pin
Richard MacCutchan24-Oct-17 22:44
mveRichard MacCutchan24-Oct-17 22:44 
GeneralRe: How to Disable open drop down Pin
yaswanthdasari25-Oct-17 0:38
Memberyaswanthdasari25-Oct-17 0:38 
AnswerRe: How to Disable open drop down Pin
Daniel Pfeffer25-Oct-17 1:11
professionalDaniel Pfeffer25-Oct-17 1:11 
GeneralRe: How to Disable open drop down Pin
yaswanthdasari25-Oct-17 23:50
Memberyaswanthdasari25-Oct-17 23:50 
QuestionHow To Add a Dll TO MFC Application in visual Studio Pin
Member 1347149317-Oct-17 21:50
MemberMember 1347149317-Oct-17 21:50 
QuestionRe: How To Add a Dll TO MFC Application in visual Studio Pin
Richard MacCutchan17-Oct-17 21:58
mveRichard MacCutchan17-Oct-17 21:58 
AnswerRe: How To Add a Dll TO MFC Application in visual Studio Pin
Member 1347149317-Oct-17 22:09
MemberMember 1347149317-Oct-17 22:09 
GeneralRe: How To Add a Dll TO MFC Application in visual Studio Pin
Richard MacCutchan17-Oct-17 22:12
mveRichard MacCutchan17-Oct-17 22:12 
GeneralRe: How To Add a Dll TO MFC Application in visual Studio Pin
Member 1347149317-Oct-17 22:29
MemberMember 1347149317-Oct-17 22:29 
GeneralRe: How To Add a Dll TO MFC Application in visual Studio Pin
Richard MacCutchan17-Oct-17 22:45
mveRichard MacCutchan17-Oct-17 22:45 
AnswerRe: How To Add a Dll TO MFC Application in visual Studio Pin
Jochen Arndt17-Oct-17 22:44
professionalJochen Arndt17-Oct-17 22:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.