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

ساعدوني في حل المصففوفه

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

lWrite a C++ program to calculate the number of days from start of the year to date spesc lNo of days for each month–31,28,31,30,31,30,31,31,30,31,30,31lOutput–pls. enter month (1 to 12)–pls. enter month (1 to 31)

lWrite a C++ program to check if the password entered by the user is correct or not lIf it is correct it gives a message “correct password ”Otherwise “Sorry, your password is incorrect

#2
#include <iostream.h>
#include <conio.h>
main()
{
int x;
cout<<"Please, Enter The Password .."<<endl;
cin>>x;
if (x==123) // فرضت أن الـ password = 123 
cout<<"Welcome,Correct Password .. "<<endl;
else
cout<<"Sorry,your Password is Incorrect .."<<endl;
getch();
}

سبحآن الله وبحمده .. سبحآن الله العظيم .. ,

#3

هذا حل السؤال الأول

#include<iostream.h>
#include<stdlib.h>

void main()
{

int m_days[12]={31,28,31,30,31,30,31,31,30,31,30,31};

 int m,dy,total_days=0;

 cout<<"Enter Date Month and Day in format MM DD\n";
 cin>>m>>dy;

 if(m<1 || m>12)
	{
	 cout<<"Month Must be between(1)and(12)Only";
	 exit(0);
	}
//Check if the Days are Equal the Month Days or Not
 if(dy<1 || dy>m_days[m-1])
	{
	  cout<<"Days Must be between(1)and("<<m_days[m-1]<<")Only";
	 exit(0);
	}

 total_days=dy;
// Here we will staet Count the Days for month 1 to m-1
// we Use m-2 becouse in Array we start from 0;
 for(int i=0;i<=(m-2);i++)
	  total_days+=m_days;
// print the total Days in year until the given Date
	  cout<<"\n The total Days="<<total_days;
}


أتمنى أن يكون المطلوب 

تحياتي

OMANI FOR EVER

-------------------------------------------------

post-12787-12780191801974.jpg

-------------------------------------------------

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

عدد الزوار حالياً

المتواجدون خلال آخر دقيقتين · يتحدّث كل ٣٠ ثانية

—الإجمالي—أعضاء مسجّلون—زوار بدون تسجيل

جارٍ التحقق من المتواجدين…