找考题网-背景图
未分类题

下列程序的运行结果是( )。 #include <stdio.h> main() { int a=2,b=3,c=4; if(a<b) if(b<0) c=0; else c+=1; printf('%d/n', c); }
A.2
B.3
C.5
D.4

A.h>
B.2
B.3
C.5

【参考答案】

C
解析:本题考查if else语句。第一个if语句,先判断条件,发现a<b条件成立,执行下列的语句;第二个if语句,先判断条件,发现b<0条件不成立,则执行与其配对的else语句,c+=1,得c=5。
热门试题

未分类题In the United States, the first day-nursery was opened in 1854.@Nurseries were established in various areas during the (1)_____ half of the 19th century; most of them were (2)_____ Both in Europe and in the U. S., the day-nursery (3)_____ received great (4)_____ during the First World War, when (5)_____ of manpower caused the industrial employment (6)_____ numbers of women. In some European countries nurseries were established (7)_____ in munitions (军火)plants, under direct government (8)_____ Although the number of nurseries in the U. S. also rose (9)_____, this rise was accomplished without government aid of any kinD.During the years following the First World War, (10)_____, Federal, State, and local governments gradually began to exercise a measure of control over the day-nurseries, chiefly by (11)_____ them and by inspecting and regulating the conditions within the nurseries.The (12)_____ of the Second World War was quickly followed by an increase in the number of day-nurseries in almost all countries, as women were again called upon to replace men in the factories. On this (13)_____ the U.S. government immediately came to the support of the nursery school, (14)_____ $6,000,000 in July, 1942, for a nursery school program for the children of working mothers. Many States and local communities (15)_____ this Federal aiD.By the end of the war, in August, 1945, more than 100,000 children were being cared for in day-care centers receiving Federal (16)_____. Soon afterward, the Federal government (17)_____ cut down its (18)_____ for this purpose and later (19)_____ them, causing a sharp drop in the number of nursery schools in operation. However, the (20)_____ that most employed mothers would leave their jobs at the end of the war was only partly fulfilleD.A.latterB.lateC.otherD.first

A.@Nurseries
B.,
C.
D.S.
E.
A.latter
B.late
C.other