Topshiriq:
A) x2-8x+12=0 tenglamani ildizlari topish dasturiy kodi va blok-sxemasi tuzilsin. B) Kubning yon tomoni a berilgan. Uning hajmini V = a*a*a; va to’la sirti S = 6*a*a;
D = b2 – 4*a*c
X1,2=( −b±sqrt(D))/2*a
V = a*a*a
S = 6*a*a
Tenglama ildizini toppish dasturi
#include
#include
#include
using namespace std;
int main()
{
int a,b,c;
cout<<"a ni kiriting ";
cin>> a;
cout<<"b ni kiriting ";
cin>> b;
cout<<"c ni kiriting ";
cin>> c;
float d = b * b -4*a*c;
if ( d < 0 ) {
cout << "Yechimga ega emas";
} else {
if (d == 0) {
float x = -b/ (2 * a);
cout << x;
} else {
float x1 = (-b + sqrt(d))/(2*a);
float x2 = (-b - sqrt(d))/(2*a);
cout <<"X1 = "<< x1 <
return 0;
}
Kubning hajmi va to’la sirtini toppish dasturi
#include
#include
using namespace std;
int main()
{
float a;
cout << "a ni kiriting ";
cin>> a;
cout<<"Kubning hajimi topilsin V=a*a*a "
cout<
cout<<"Kubning to'la sirti topilsin S=6*a*a "<
float S=6*a*a;
cout<
return 0;
}
Men ushbu labaratoriya ishida arifmetik amallarni bajarish haqida anchagina ma’lumotga ega bo’ldim. Ishni bajarish davomida arifmetik amallarni blok sxemasini yaratishni va bu orqali dasturlash tilida ushbu misollarni bajarilish dasturini yaratishni o’rgandik. Amaliyot darslarida o’rganganlarimiz va nazariyalar orqali olgan bilimlarimizni qo’llagan holda ushbu labaratoriya ishini bajardik. Dasturimiz muvofaqiyatli chiqdi va missollarni ishlanish jarayonilarini rasm holatida joyladim.
http://fayllar.org
Dostları ilə paylaş: |