※スタイルシート未対応ブラウザではレイアウトを正確に再現できません。
  > | advanced by | contents  | that returns in <    
                   < [modosusu] > Color magazine monochrome light and shade   font predetermined, Gothic Ming-style type longhand   size Konaka large   standard  


  Exercise 7   

  1. ..clause 1..: Basic knowledge
  2. ..clause 2..: Program readout
  3. Memo
  4. ..clause 4..: Description type
  5. ..clause 5..: Basic knowledge(example solution)
  6. ..clause 6..: Program readout(example solution)
  7. Memo(example solution)
  8. ..clause 8..: Description type(example solution)


[1] Basic knowledge


[  1-1  ]
What are called numerical values other than 0 when it is a conditional judgment?

[  1-2  ]
What is called 0 when it is a conditional judgment?

[  1-3  ]
What is called the summary of two or more sentences by inclosing it [de]?
Example solution

It returns to contents.


[2] Program readout


[  2-1  ]
For what display is the following program a program?
Judging from the content of processing and the variable identifier, answer.
 
#include <stdio.h> 

int main(void)  
{
	int value,rest;  
	
	scanf("%d",&value);  
	
	rest = value % 2;  
	
	if (rest == 0) printf("E");  
	if (rest == 1) printf("O");  
	
	printf("\n");  
	
	return 0;
}
Example solution

It returns to contents.


Memo


[  3-1  ]
When the age is input at the Christian era, is the Olympics held in the age?
Make the displayed program.
The distinction in summer and winter can be displayed if it is possible and it is still good.
The hint: The Sydney Olympics (summer) was holding in 2000.
- Because the condition becomes confusing
  Disregard it at the time of the same year summer and winter before.
Example solution

It returns to contents.


[4] Description type


[  4-1  ]
 
if (-1) printf("OK\n");
Though OK is displayed when the above-mentioned program is executed
Explain it concisely why.
Example solution

It returns to contents.


[5] Basic knowledge(example solution)


[  1-1  ]
The truth
- In English True.

[  1-2  ]
Imitation
- In English False.

[  1-3  ]
Block Or complex sentence
Problem

It returns to contents.


[6] Program readout(example solution)


[  2-1  ]
Display the odd number or the even number the input value.
- O The abbreviation of odd and E : It is abbreviation of even.
- % calculates the remainder. It doesn't forget.
- The last printf function exists only to change line.
Problem

It returns to contents.


Memo(example solution)


[  3-1  ]
 
#include <stdio.h> 

int main(void) 
{
	int year; 
	
	Printf ("Input the age at the Christian era");
	scanf("%d",&year); 
	
	If (year % 4 == 0) Printf ("Olympic Summer Games \n");
	If (Year % 2 == 0 & year % 4 =   0) Printf ("Olympic 
	Winter Games \n");If (Year % 2 =   0) Printf ("\n that is 
	not the Olympics");
	
	return 0; 
}
- Here, year when the Olympics is held can be secondarily divided.
  In addition, it was used to divide by even four at the Olympic Summer Games.
- It is assumed that it answers correctly if it requests it by the calculation because other computational methods are thought.
- When the ages are compared as they are without calculating, it is assumed that it mistakes.
Problem

It returns to contents.


[8] Description type(example solution)


[  4-1  ]
Because all numerical values except 0 are considered to be the truth in the if sentence
Because it executes it even if it is a negative value.
Problem

It returns to contents.


< - It is advanced -> | in | head that returns  to returning  next |.