Предмет: Информатика, автор: ljq32057

Pascal. Есть целая переменная n и вещественная переменная y. Какие из следующих операторов присваивания верные, а какие нет и почему?

y:=n , n:=y , y:=5,41 , y:=n mod 4 , n:=(5*n)/5 , n=5*n ,

n:= trunc(n/4) , y:=y mod n.

Ответы

Автор ответа: kombat1488
1

1)

y:=n;

Верно.

Вещественная переменная может быть целой.

2)

n:=y;

Неверно.

Целая переменная не может быть вещественной. (На то она и целая)

3)

y:=5.41;

Верно.

4)

y:= n mod 4;

Верно.

5)

n:=(5*n)/5;

Неверно.

Целые числа нельзя делить.

6)

n=5*n;

Неверно.

Должен быть знак := а не =

7)

n:=trunc(n/4);

Верно.

Функция trunc отбрасывает дробную часть числа, делая его целым.

8)

y:=y mod 4;

Неверно.

У вещественных чисел нет остатка от деления.

Похожие вопросы
Предмет: Английский язык, автор: evgniyzheka
переведите
Oxford
1.What is so special about Oxford and Cambridge, the two oldest English universities? Why do so many students want to study there?
2.Both of these university towns are very beautiful. They have some of the finest architecture in Britain. Some of their colleges, chapels and libraries are three, four and even five hundred years old, and are full of valuable books and precious paintings. Both towns have many lovely gardens, where the students can read and relax in the summer months.
3.Oxford is the older university of the two. The first of its colleges was founded in 1249. The university now has thirty-four colleges and about twelve thousand students, many of them from other countries. There were no women students at Oxford until 1878, when the first women’s college, Lady Margaret Hall, opened. Now, women study at most colleges.
4.Oxford is, of course, famous for its first-class education as well as its beautiful buildings. Some of the most intelligent men and women in the country live and work here. Oxford gives them what they need: a quiet atmosphere, friendly colleagues, and the four-hundred-year-old Bodleian library, which has about five million books.
5.It is not easy to get a place at Oxford University to study for a degree. But outside the university there are many smaller private colleges which offer less difficult courses and where it is easy to enroll. Most students in these private schools take business, secretarial or English language courses.
Предмет: Английский язык, автор: solodynov29
Предмет: Математика, автор: Laura11111Kz
Предмет: Математика, автор: катарида