الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

تصحيح كود صغير

بدأه السهم الثاقب في 29 أبريل 2009 · 2 رد · 423 مشاهدة · في الأسئلة المجابة
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

write a function that computes the summation of two array(one dimensional array ) (the same size ) and store the result in the first array ?

function.

void main(int a[ ] ,int b[ ] ); (

#include<iostream.h>
void sum(int a[],int b[]){
	for(int i=0;i<10;i++)
		a+=b;
}

	void main(int a[10],int b[10]){
		for (int j=0;j<10;j++){
			cin>>a[j];}
		for(int k=0;k<10;k++){
			cin>>k[10];}
		sum(a)
			for(int l=0;l<10;l++)
			cout<<a[k];

	}
#2
#include<iostream.h>
void sum(int a[],int b[])
{
	for(int i=0;i<10;i++)
		a+=b;
}

void main()
{
		int a[10],b[10];
		cout<<"Enter First Array:"<<endl;
		  for (int j=0;j<10;j++)
		{
			cin>>a[j];
		}
		cout<<"Enter Second Array:"<<endl;
		for(int k=0;k<10;k++)
		{
			cin>>b[k];
		}
		sum(a,b);
		cout<<"First Array After Summation:"<<endl;
			for(int l=0;l<10;l++)
			cout<<a[l]<<endl;

 }
llback.jpg

اشهد ان لا إله إلا الله وان محمدا ً رسول الله

#3

يعطيكم الف عافية

مواضيع مشابهة