int main()
{
}
//힌트!!
#include <stdio.h>
int main(){
int a=10,b=12,temp;
//코드를 넣어주세요
printf("%d %d",a,b);
//이때 출력값은 12와 10이 되어야겠지요?
return 0;//이게 뭔지는 신경쓰지 마세요.
}
)
#include <stdio.h>
int main(){
int a=21,b=2,c;
a=a*b;
c=a+b;
printf("안녕하세요, 우리반입니다. 1+3=%d",c+b);
return 0;
}
#include <stdio.h>
int main(){
char a='d';
int b;
char e=a;
printf("%c",e);
return 0;
}
무엇이 출력될까요?
#include <stdio.h>
int main(){
int height;
scanf("%d",&height);
if(164==height) printf("정진경");
else if(171==height) printf("이미경");
else if(187==height) printf("권도현");
....
return 0;
}
#include <stdio.h>
int main()
{
int a=164, height;
scanf("%d",&height);
if(164==height) {
printf(" 정진경");
}
if (171==height){
printf("이미경");
}else if(187==height){
printf("권도현");
}else if(height<180){
printf("정상인");
}else{
printf("위너");
}
return 0;
}
#include <stdio.h>
int main(){
int a=2;
a+=3; // a=a+3;
return 0;
}
#include <stdio.h>
int main(){
char a='a',c='d';
c=a+1;
printf("%c",c);
return 0;
}
이 프로그램의 출력값은?
switch(height){
case 171:
printf("미경이");
case 187:
printf("도현이");
default:
printf("너 키 뭐니");
}
스위치를 이용한 키 확인
for(i=0;i<=100;i++){
for(j=0;j<100;j++)
printf("%d\n",i);
}
1 2 3 4 5 6 7 8 9 10 2 4 6 8 10 12 14 16 18 20 3 6 9 12 15 18 21 24 27 30 . . .
*****
****
***
**
*
1112111 1112111 1112111 3333333 1112111 1112111 1112111
#include <stdio.h>
int function(int fa,int fb);
int funct(int fa,int fb);
int main()
{
int a,j,b;
a=10;
b=12;
for(j=0;j<5;j++){
a+=function(a,b);
}
}
int funct(int fa,int fb)
{
return fa+1;
}
int function(int fa,int fb)
{
fa=funct(fa,fb);
printf("%d %d\n",fa,fb);
return 0;
}
-권도현