عرض مشاركة واحدة
قديم 2011-03-15, 11:04 PM   #5


الصورة الرمزية رهين الشوق
رهين الشوق غير متواجد حالياً

بيانات اضافيه [ + ]
 رقم العضوية : 1
 تاريخ التسجيل :  Sep 2008
 أخر زيارة : 2025-02-03 (07:35 PM)
 المشاركات : 37,159 [ + ]
 التقييم :  13489
 الدولهـ
Saudi Arabia
 الجنس ~
Male
 MMS ~
MMS ~
 SMS ~
العز لِـ النفس وآجب والحياء سنه وأنا يديني من الثنتين مليانه ..
لوني المفضل : Blue
افتراضي رد: نبضات رهين الشوق



وحل السؤال الرابع والخامس من دفتري العزيز

#include<iostream.h>
#include<stdio.h>
main()
{
int x,max1,max2,i=2;
cout<<" Enter Number 1 = ";
cin>>x;
max1=x;
max2=x;
while(i<=5)
{
cout<<" Enter Number "<<i<<" = ";
cin>>x;
if (x>max1)
{
max2=max1;
max1=x;
}
else if (x<max1)
{
if(x>max2||max1==max2)
{
max2=x;
}
}
i++;
}
cout<<" The First Largest = "<<max1<<endl;
cout<<" The Second Largest = "<<max2;
g***har();
}

والخامس كالتالي
#include <iostream.h>
#include <stdio.h>
int main()
{
int input , s , m , h;

cin>>input;
h=input/3600;
m=input%3600/60;
s=input%60;

cout<<"hours is= "<<h<<endl;
cout<<"minutes is= "<<m<<endl;
cout<<"seconds is= "<<s<<endl;

g***har();
return 0;
}

ولي باك


 
 توقيع : رهين الشوق



رد مع اقتباس