전자 공학도를 위한 c언어 6장 프로그램
본 자료는 8페이지 의 미리보기를 제공합니다. 이미지를 클릭하여 주세요.
닫기
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
해당 자료는 8페이지 까지만 미리보기를 제공합니다.
8페이지 이후부터 다운로드 후 확인할 수 있습니다.

소개글

전자 공학도를 위한 c언어 6장 프로그램에 대한 보고서 자료입니다.

목차

▤ 프로그램 6.1 /* 표현식이 생략된 for문 */
#include <stdio.h>

main()
{
int a=0, b=0;

for(;;){ /* 무한루프를 형성하는 형태 */
printf(\"정수 입력 : \");
<생략>

본문내용

(B!=1)))
{
puts("Invalid input");
okay=FALSE;
}
else okay=TRUE;
} while ( !okay );
do
{
printf("Enter C input (0 or 1) >>");
rtn=scanf("%d",&C);
if ((rtn!=1) ||( (C!=0) && (C!=1)))
{
puts("Invalid input");
okay=FALSE;
}
else okay=TRUE;
} while ( !okay );
Z=!((A && B) || C);
printf("Output will be %d\n",Z);
printf("Do you wish to continue (y/n) >>");
fflush(stdin);
/* this will flush the keyboard buffer */
/* as there may be characters still in it */
ch=getchar();
} while (tolower(ch)=='y');
return(0);
}
▤ 프로그램 6.52
/*Program to determine the gain of an CR */
/*active filter for an entered values of C and R*/
/*and a frequency span from 1Hz up to 1 GHz in*/
/*decadesteps*/
#include
#include
#defineTRUE1
#defineFALSE0
#defineMILLI1e-3
#defineKILO1e3
#defineMEGA1e6
#defineGIGA1e9
#definePI3.14159
int main(void)
{
floatresistance,capacitance,freq,gain,gain_dB;
intrtn,okay;
puts("Program to determine gain of a CR active filter");
do
{
printf("Enter capacitance >>");
rtn=scanf("%f",&capacitance);
if ((rtn!=1) || (capacitance>MILLI))
{
puts("INVALID: re-enter");
okay=FALSE;
}
elseokay=TRUE;
} while (!okay );
do
{
printf("Enter resistance >>");
rtn=scanf("%f",&resistance);
if ((rtn!=1) || ((resistance>=MEGA) || (resistance {
puts("INVALID: re-enter");
okay=FALSE;
}
else okay=TRUE;
} while (!okay);
puts("FREQUENCY(Hz) GAIN(dB)");
for (freq=1;freq<=GIGA;freq*=10)
{/* decade steps of frequency*/
gain=2*PI*freq*resistance*capacitance;
gain_dB=20*log10(gain);
printf("%10.1e %10.3f\n",freq,gain_dB);
}
return(0);
}
▤ 프로그램 6.53
/*Prints the square of the numbers 1 to 10*/
/*ie 1,4,9..100*/
#include
intmain(void)
{
int i;
for (i=1,i<10,i++)
printf("The square of i is %d,i*i);
return(0);
}
▤ 프로그램 6.54
/*Prints values from 1 to 100 in power of 3 */
/*The step used is 0.3*/
#include
intmain(void)
{
int i;
while (i != 100)
{
printf("%d to the power of three is %d /n",i*i*i);
i += 0.3;
return(0);
}
▤ 프로그램 6.55
/* Prints the square of the numbers 1 to 10 */
/*ie 1,4,9..100*/
#include
intmain(void)
{
int i;
for (i=1;i<=10;i++);
printf("The square of i is %d,i*i);
return(0);
}
▤ 프로그램 6.56
/* Program to determine input resistance given the*/
/*input voltage and current*/
#include
int main(void)
{
char input;
puts("Program to determine the resistance given");
puts("input voltage and current");
while (input == 'y')
{
printf("Enter voltage and current >> ");
scanf("%f %f",voltage,current);
printf("The resistance is %f",voltage/current);
puts("Do you wish to continue (y/n)")
input = getchar();
}
return(0);
}
▤ 프로그램 6.57
#defineTRUE1
#include
int main(void)
{
puts("Program to determine the resistance given");
puts("input voltage and current");
while (TRUE)
{
printf("Enter voltage and current >> ");
scanf("%f %f",voltage,current);
printf("The resistance is %f",voltage/current);
puts("Do you wish to continue(y/n)");
ch=getchar();
if ((ch=='n') && (ch=='N')) break;
}
puts("Program exited");
return(0);
}
  • 가격3,000
  • 페이지수24페이지
  • 등록일2006.04.17
  • 저작시기2006.4
  • 파일형식한글(hwp)
  • 자료번호#344643
본 자료는 최근 2주간 다운받은 회원이 없습니다.
청소해
다운로드 장바구니