C Program to Read Set of Real Numbers from Keyboard & Find the Maximum

0

C Program to Read Set of Real Numbers and Find the Maximum
To write a C program to read set of real numbers from keyboard and find the maximum among them, you can use a function which takes an array of real numbers and its size as arguments and return the maximum.


Using this function you can write a program to read a set of real numbers from the keyboard and find the maximum number in the array.






C Program to Read Set of Real Numbers and Find the Maximum



Steps: 
  1. Define a function max() 
  2. Under main() function, declare two integers i and n.
  3. Declare an array a.
  4. Prompt the message to the user to insert how many elements they want to enter using printf() and allow to enter using scanf().
  5. Prompt the message and allow to enter the elements.
  6. Find out the maximum number among them using max() function.
  7. Print the maximum number along with message.

Code:


#include<stdio.h>
#include<conio.h>

max(float a[], int n);

void main()
{

int i,n;
float a[100];


printf("\n How many elements you want to enter:\n");
scanf("%d",&n);

printf("\n Enter the elements:");
for(i=0;i<n;i++)
scanf("%f",&a[i]);
max(a,n);
getch();
}

max(float a[], int n)

{
int i;
float k, large;
large=a[0];
for (i=1;i<n;i++)
{
if (a[i]>large)
{
k=a[i];
a[i]=large;
large=k;
}
}

printf("Largests element is : %f", large);

return 0;

}


 

Related Posts: 


Write a Program in C to Determine Whether a Number is Prime or Not.

0

Program in C to Determine Whether a Number is Prime or Not.
"A prime number is one, which is divisible only by 1 or itself."

To determine whether a number is prime or not, we have to divide the number successively by all numbers from 2 to one less than itself.

If remainder of any of these divisions is zero, the number is not a prime.

If no division yields a zero then the number is a prime number.



Program in C to Determine Whether a Number is Prime or Not


Steps:

  1. Declare integers num and i inside main()
  2. Prompt the message allow the input using printf() and scanf()
  3. Test whether a Number is prime or not using while() function.

Code:

#include <stdio.h>

int main()
{

int num, i;


printf("Enter a number");
scanf ("%d",&num);

i=2;

while (i<=num-1)
{

if (num%i==0)
{
printf("Not a prime number\n");
break;
}

i++;
}

if (i==num)

printf("Prime number\n");

return 0;
}



Related Posts: 



Solved MCQ of Data Warehouse set-3

0

OLAP Cube illustration
OLAP Cube illustration (Photo credit: Wikipedia)

1. Data warehouse architecture is based on .......................

A) DBMS

B) RDBMS

C) Sybase





2. .......................... supports basic OLAP operations, including slice and dice, drill-down, roll-up and pivoting.

A) Information processing

B) Analytical processing

C) Data mining

D) Transaction processing




3. The core of the multidimensional model is the ....................... , which consists of a large set of facts and a number of dimensions.

A) Multidimensional cube

B) Dimensions cube


D) Data model




4. The data from the operational environment enter ........................ of data warehouse.

A) Current detail data

B) Older detail data

C) Lightly Summarized data

D) Highly summarized data




5. A data warehouse is ......................

A) updated by end users.


B) contains numerous naming conventions and formats


C) organized around important subject areas


D) contain only current data




6. Business Intelligence and data warehousing is used for ..............

A) Forecasting


C) Analysis of large volumes of product sales data

D) All of the above




7. Data warehouse contains ................ data that is never found in the operational environment.

A) normalized

B) informational

C) summary

D) denormalized





8. ................... are responsible for running queries and reports against data warehouse tables.

A) Hardware

B) Software

C) End users

D) Middle ware




9. The biggest drawback of the level indicator in the classic star schema is that is limits ............

A) flexibility

B) quantify

C) qualify

D) ability





10. ............................. are designed to overcome any limitations placed on the warehouse by the nature of the relational data model.


B) Relational database

C) Multidimensional database

D) Data repository






Answers:




1. Data warehouse architecture is based on .........................

B) RDBMS


2. .......................... supports basic OLAP operations, including slice and dice, drill-down, roll-up and pivoting.

B) Analytical processing


3. The core of the multidimensional model is the ....................... , which consists of a large set of facts and a number of dimensions.

C) Data cube



4. The data from the operational environment enter ........................ of data warehouse.

A) Current detail data


5. A data warehouse is ......................

C) organized around important subject areas


6. Business Intelligence and data warehousing is used for ..............

D) All of the above


7. Data warehouse contains ................ data that is never found in the operational environment.

C) summary


8. ................... are responsible for running queries and reports against data warehouse tables.

C) End users



9. The biggest drawback of the level indicator in the classic star schema is that is limits ............

A) flexibility


10. ............................. are designed to overcome any limitations placed on the warehouse by the nature of the relational data model.

C) Multidimensional database





Related posts



MCQ on Data Warehouse with Answers set-2

0

Data Warehouse Overview
Data Warehouse Overview (Photo credit: Wikipedia)


1. The full form of OLAP is


A) Online Analytical Processing

B) Online Advanced Processing

C) Online Advanced Preparation

D) Online Analytical Performance




2. ......................... is a subject-oriented, integrated, time-variant, nonvolatile collection or data in support of management decisions.

A) Data Mining

B) Data Warehousing

C) Document Mining

D) Text Mining




3. The data is stored, retrieved and updated in ....................

A) OLAP

B) OLTP

C) SMTP

D) FTP




4. An .................. system is market-oriented and is used for data analysis by knowledge workers, including managers, executives, and analysts.

A) OLAP

B) OLTP

C) Both of the above

D) None of the above





5. ........................ is a good alternative to the star schema.

A) Star schema

B) Snowflake schema

C) Fact constellation

D) Star-snowflake schema




6. The ............................ exposes the information being captured, stored, and managed by operational systems.

A) top-down view

B) data warehouse view

C) data source view

D) business query view




7. The type of relationship in star schema is ...............

A) many to many

B) one to one

C) one to many

D) many to one





8. The .................. allows the selection of the relevant information necessary for the data warehouse.

A) top-down view

B) data warehouse view

C) data source view

D) business query view




9. Which of the following is not a component of a data warehouse?

A) Metadata

B) Current detail data

C) Lightly summarized data

D) Component Key




10. Which of the following is not a kind of data warehouse application?

A) Information processing

B) Analytical processing

C) Data mining

D) Transaction processing


Answers:




1. The full form of OLAP is

A) Online Analytical Processing


2. ......................... is a subject-oriented, integrated, time-variant, nonvolatile collection or data in support of management decisions.

B) Data Warehousing


3. The data is stored, retrieved and updated in ....................

B) OLTP


4. An .................. system is market-oriented and is used for data analysis by knowledge workers, including managers, executives, and analysts.

A) OLAP


5. ........................ is a good alternative to the star schema.

C) Fact constellation


6. The ............................ exposes the information being captured, stored, and managed by operational systems.

C) data source view


7. The type of relationship in star schema is ...............

C) one to many


8. The .................. allows the selection of the relevant information necessary for the data warehouse.

A) top-down view


9. Which of the following is not a component of a data warehouse?

D) Component Key


10. Which of the following is not a kind of data warehouse application?

D) Transaction processing





Related Posts





MCQ on Data Mining with Answers set-1

0


1. ...................... is an essential process where intelligent methods are applied to extract data patterns.


MCQ on Data Mining with AnswersA) Data warehousing

B) Data mining

C) Text mining

D) Data selection



2. Data mining can also applied to other forms such as ................


i) Data streams

ii) Sequence data

iii) Networked data

iv) Text data

v) Spatial data

A) i, ii, iii and v only

B) ii, iii, iv and v only

C) i, iii, iv and v only

D) All i, ii, iii, iv and v



3. Which of the following is not a data mining functionality?

A) Characterization and Discrimination

B) Classification and regression

C) Selection and interpretation

D) Clustering and Analysis



4. ............................. is a summarization of the general characteristics or features of a target class of data.

A) Data Characterization

B) Data Classification

C) Data discrimination

D) Data selection





5. ............................. is a comparison of the general features of the target class data objects against the general features of objects from one or multiple contrasting classes.

A) Data Characterization

B) Data Classification

C) Data discrimination

D) Data selection



6. Strategic value of data mining is ......................

A) cost-sensitive

B) work-sensitive

C) time-sensitive

D) technical-sensitive



7. ............................. is the process of finding a model that describes and distinguishes data classes or concepts.

A) Data Characterization

B) Data Classification

C) Data discrimination

D) Data selection



8. The various aspects of data mining methodologies is/are ...................

i) Mining various and new kinds of knowledge

ii) Mining knowledge in multidimensional space

iii) Pattern evaluation and pattern or constraint-guided mining.

iv) Handling uncertainty, noise, or incompleteness of data


A) i, ii and iv only

B) ii, iii and iv only

C) i, ii and iii only

D) All i, ii, iii and iv



9. The full form of KDD is ..................

A) Knowledge Database

B) Knowledge Discovery Database

C) Knowledge Data House

D) Knowledge Data Definition



10. The out put of KDD is .............

A) Data

B) Information

C) Query

D) Useful information



Answers:




1. ...................... is an essential process where intelligent methods are applied to extract data patterns.

B) Data mining

2. Data mining can also applied to other forms such as ................

i) Data streams

ii) Sequence data

iii) Networked data

iv) Text data

v) Spatial data

D) All i, ii, iii, iv and v

3. Which of the following is not a data mining functionality?

C) Selection and interpretation


4. ............................. is a summarization of the general characteristics or features of a target class of data.

A) Data Characterization


5. ............................. is a comparison of the general features of the target class data objects against the general features of objects from one or multiple contrasting classes.

C) Data discrimination


6. Strategic value of data mining is ......................

C) time-sensitive


7. ............................. is the process of finding a model that describes and distinguishes data classes or concepts.

B) Data Classification


8. The various aspects of data mining methodologies is/are ...................

i) Mining various and new kinds of knowledge

ii) Mining knowledge in multidimensional space

iii) Pattern evaluation and pattern or constraint-guided mining.

iv) Handling uncertainty, noise, or incompleteness of data

D) All i, ii, iii and iv


9. The full form of KDD is ..................

B) Knowledge Discovery Database


10. The out put of KDD is .............

D) Useful information




Related Posts



Solved Objective Questions for IT Officer Exam Part-3

0

Network topology Mesh topology
Mesh topology (Photo credit: Wikipedia)

1. What is the name of the network topology in which there are bi-directional links between each possible node?

A) Ring


B) Star

C) Tree

D) Mesh




2. Which scheduling policy is most suitable for time-shared operating system?

A) Shortest job first

B) Round-robin

C) Elevator

D) First-come-first-serve



3. A next-generation web content development language, ................ typically refers to a suite of technologies that allow developers to store data in a readable format.

A) HTML

B) XML

C) XSL

D) PHP



4. A(n) ................... is a private corporate network that uses standard Internet protocols and interfaces.

A) Internet

B) Extranet

C) Local Area Network

D) Intranet



5. Integrated Circuit is related to .......................... generations computers.

A) Second

B) Third

C) Fourth

D) Fifth




6. Which of the following is the most suitable scheduling scheme in a real time operating system?

A) Round robin

B) First come first serve

C) Preemptive scheduling

D) Random Scheduling



7. Kernel is .........

A) Considered as the critical part of the operating system

B) The software which monitors the operating system

C) The set of primitive functions upon which the rest of operating system functions are build up

D) None of the above



8. Which of the following storage is fastest?

A) RAM

B) ROM

C) Register

D) Blu-ray disc



9. A polymorphic virus .........

A) Modifies its program code each time it attaches itself to another program or file.

B) Is a malicious-logic program that copies itself repeatedly in memory or on a disk drive until no memory or disk space remains.

C) A malicious-logic program that hides within or looks like a legitimate program.

D) Infects a program file, but still reports the size and creation date of the original, uninfected program.



10. Cache Memory ......

A) Helps to store more data in hard disk

B) Placed between main memory and microprocessor

C) Stores data permanently

D) Holds last time visited web site only





Answers:


1. What is the name of the network topology in which there are bi-directional links between each possible node?

D) Mesh

Explanation: A mesh network is a local area network (LAN) that employs one of two connection arrangements, full mesh topology or partial mesh topology. In the full mesh topology, each node (workstation or other device) is connected directly to each of the others. Read More: mesh network -whatis.techtarget.com and Network Topology - wikipedia.org


2. Which scheduling policy is most suitable for time-shared operating system?

B) Round-robin

Explanation: In the round robin scheduling, processes are dispatched in a FIFO manner but are given a limited amount of CPU time called a time-slice or a quantum. If a process does not complete before its CPU-time expires, the CPU is preempted and given to the next process waiting in a queue. Read More: CPU/Process Scheduling -personal.kent.edu


3. A next-generation web content development language, ................ typically refers to a suite of technologies that allow developers to store data in a readable format.

B) XML

Explanation: Extensible Markup Language (XML) is a markup language that defines a set of rules for encoding documents in a format that is both human-readable and machine-readable. It is a textual data format with strong support via Unicode for the languages of the world. Although the design of XML focuses on documents, it is widely used for the representation of arbitrary data structures. Read More: Extensible Markup Language (XML) -wikipedia.org


4. A(n) ................... is a private corporate network that uses standard Internet protocols and interfaces.

D) Intranet

Explanation: An intranet is a private computer network that uses Internet Protocol technologies to securely share any part of an organization's information or network operating system within that organization. Read More: Intranet - princeton.edu


5. Integrated Circuit is related to .......................... generations computers.

B) Third

Explanation:The mass increase in the use of computers accelerated with 'Third Generation' computers. These generally relied on Jack Kilby's invention of the integrated circuit (or microchip), starting around 1965. Read More: History of computing hardware - wikipedia.org


6. Which of the following is the most suitable scheduling scheme in a real time operating system?

C) Preemptive scheduling

Explanation: A real-time operating system (RTOS) is an operating system (OS) intended to serve real-time application requests. It must be able to process data as it comes in, typically without buffering delays.

A scheduling decipline is preemptive if, once a process has been given the CPU can taken away. The strategy of allowing processes that are logically runable to be temporarily suspended is called Preemptive Scheduling and it is contrast to the "run to completion" method.


7. Kernel is .........

C) The set of primitive functions upon which the rest of operating system functions are build up

Explanation: The Operating System Kernel does Basic set of primitive operations and processes Like a function call or macro expansion, Part of the calling process, Critical section for the process etc. Read more: Process Scheduling -cs.umsl.edu


8. Which of the following storage is fastest?

C) Register


Explanation: Register is faster than RAM, ROM and Blu-ray disc.


9. A polymorphic virus .........

A) Modifies its program code each time it attaches itself to another program or file.

Explanation: Polymorphic viruses create varied (though fully functional) copies of themselves as a way to avoid detection by anti-virus software. Some polymorphic virus use different encryption schemes and require different decryption routines. Read More: Polymorphic viruses


10. Cache Memory ......

B) Placed between main memory and microprocessor

Explanation: The Performance of a microcomputer system can be improved significantly by introducing a small expensive but fast memory between microprocessor and main memory. Read more: Cache Memory



Solved MCQ for IT Officer Exam Part-2

0

SWIFT Logo
SWIFT Logo (Photo credit: Wikipedia)
1. SWIFT stands for:

A) Society for Worldwide Interbank Financial Telecommunication

B) Society for Worldwide International Financial Telecommunication

C) Society for Worldwide Interbank Financial Transmission

D) Society for Worldwide Interbank Financial Transfer



2. Which one is the correct statement?

A) XML is a technology used only on the internet.

B) XML is a programming language.

C) XML is highly suitable data exchange between two different systems.

D) XML is scripting language.



3. Decision support systems usually

A) serve managers interested in weekly, monthly and yearly results, not day-to-day activities.

B) help managers make decisions that are unique, rapidly changing and not easily specified in advance.

C) provide managers with a generalized computing and telecommunications capacity that can be applied to a changing array of problems.

D) perform and record the daily routine transactions necessary to the conduct of business.



4. Identifying customers and markets using data on demographics, markets, consumer behavior and trends is an example of a (n):

A) operational-level sales and marketing information system

B) knowledge-level sales and marketing information system

C) strategic-level sales and marketing information system

D) management-level sales and marketing information system



5. Enterprise systems support:

A) manufacturing process

B) financial and accounting process

C) human resource processes

D) all of the above



6. An example of an information to support a strategic management is:

A) spreadsheet model of income projections

B) business intelligence system

C) electronic document management system

D) financial information system



7. Which type of software is focused in supporting communication, collaboration and coordination?

A) E-business software

B) CRM software

C) groupware

D) SCM software



8. A data warehouse is .........

A) updated by end users

B) contains numerous naming conventions and formats

C) organized around important subject areas

D) contains only current data



9. Capability of data mining is to build ................ models.

A) retrospective

B) interrogative

C) predictive

D) imperative



10. A link is said to be ............... link if it is between pages with different domain names.

A) intrinsic

B) transverse

C) direct

D) contrast



Answers:




1. SWIFT stands for:

A) Society for Worldwide Interbank Financial Telecommunication

Explanation: The Society for Worldwide Interbank Financial Telecommunication provides a network that enables financial institutions worldwide to send and receive information about financial transactions in a secure, standardized and reliable environment. Read More at: wikipedia.org


2. Which one is the correct statement?

C) XML is highly suitable data exchange between two different systems.

Explanation: XML data is stored in plain text format. This provides a software and hardware independent way of storing data. XML is highly suitable data exchange between two different systems, since the data can be read by different incompatible applications. Read More at: How Can XML be Used?-w3schools.com.


3. Decision support systems usually

B) help managers make decisions that are unique, rapidly changing and not easily specified in advance.

Explanation: Decision support systems usually help managers make decisions that are unique, rapidly changing and not easily specified in advance. Read More at: Decision support systems -books.google.com


4. Identifying customers and markets using data on demographics, markets, consumer behavior and trends is an example of a (n):

B) knowledge-level sales and marketing information system

Explanation: Identifying customers and markets using data on demographics, markets, consumer behavior and trends is an example of a knowledge-level sales and marketing information system.


5. Enterprise systems support:

D) all of the above

Explanation: Enterprise systems support manufacturing process, financial and accounting process and human resource processes. Read More: Enterprise systems -books.google.com


6. An example of an information to support a strategic management is:

B) business intelligence system

Explanation: An example of an information to support a strategic management is business intelligence system. Read More: Business Intelligence System -books.google.com


7. Which type of software is focused in supporting communication, collaboration and coordination?

C) groupware

Explanation: Groupware is a type of software is focused in supporting communication, collaboration and coordination. Read More: Groupware -wikipedia.org


8. A data warehouse is .........

C) organized around important subject areas

Explanation: A data warehouse can be used to analyze a particular subject area. Read more: Data warehouse definition -1keydata.com


9. Capability of data mining is to build ................ models.

C) predictive

Explanation: Capability of data mining is to build predictive models.



10. A link is said to be ............... link if it is between pages with different domain names.

B) transverse

Explanation: A link is said to be transverse link if it is between pages with different domain names and A link is said to be intrinsic link if it is between pages with same domain names. Read More: transverse and intrinsic link -books.google.com





Related Posts:



يتم التشغيل بواسطة Blogger.