//============================================================================
//  제출일 : 2005. 3. 12
//  작업환경 :  Windows XP SP1, VC++ 6.0, Pentium4
//  연습문제 4-40
//============================================================================

#include <iostream.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>

int main()
{
 float number;
 int rand_num;
 float product;
                                //Process No.
 cout << "Enter a number\n"; //1
 cin >> number;    //2
 cout << number << "\n";  //3

 srand(time(NULL)); //Seed Initianlization //4
 rand_num = rand()%35+3; //Get a Random number
 cout << rand_num << "\n"; //5

 product = number * rand_num; //6
 cout << ceil(product)<< "\n"; //7
 cout << pow(number, 5)<< "\n"; //8
 cout << floor (product)<< "\n"; //9
 cout << pow(number, 5)<< "\n"; //10
 cout << sqrt(product)<< "\n"; //11

 return 0;
}


Posted by 지그프리드 지그프리드

댓글을 달아주세요:: 네티켓은 기본, 스팸은 사절


BLOG main image
일상, 프로그래밍, IT 그리고 직장생활, Dive, 여행 by 지그프리드

카테고리

Class List (402)
Studies (30)
Exercise & Quizz (10)
Term Project (0)
ECIM list (Help!) (10)
Issues & News (0)
Gossip about IT & Job (22)
Tools (2)
Think about the Justice (23)
Book Review (170)
조엘 온 소프트웨어(번역) (28)
Diary (87)
Vacations (9)
Clash of clans 클래시 오브.. (11)

글 보관함

달력

«   2019/11   »
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
Total : 315,137
Today : 26 Yesterday : 27