The document provides details of two lab assignments for a computer programming course. The first assignment introduces concepts like variables, data types, if/else statements and asks students to write 10 programs demonstrating these concepts. The second assignment covers loops, arrays, switch case and asks students to write 6 programs applying these concepts. It provides the details, date and expectations for evaluating the assignments.
This ppt contains information about concepts of wireless communication, signal propagation effects, spread spectrum, cellular systems, multiple access systems.
Gives you the complete knowledge of different channel allocation techniques, reverse and forward CDMA, GSM Frame Structure, GSM channel Types, cellular concepts, handoff strategies, Frequency reuse and GSM call structure.
This PDF provides a in-depth explanation for all the concepts and practices used before.
55 Different Types of Antennas With Examples Used in Wireless Communication.pdfAntenna Manufacturer Coco
After the read about these 55 different types of antennas, you will learn about the different types of antennas with examples and their use.
As an important part of wireless communication systems, the antenna plays an irreplaceable role. In our life, there are many types of wireless communication requirements, such as long-distance wireless communication, short-distance wireless communication, satellite wireless communication, microwave wireless communication, cell phone wireless communication, point-to-point wireless communication, point-to-face wireless communication, and so on.
Different wireless communications requirements correspond to the use of different types of antenna wireless communication frequency bands, and different wireless communication systems, so it is necessary to use different types of antennas.
The design and selection of different types of antennas are an important part of designing a wireless transceiver for RF systems. A good RF wireless antenna system can make the communication distance the best state. The size of the same type of antenna is proportional to the wavelength of the RF signal. The lower the signal frequency, the larger the antenna needed.
This ppt contains information about concepts of wireless communication, signal propagation effects, spread spectrum, cellular systems, multiple access systems.
Gives you the complete knowledge of different channel allocation techniques, reverse and forward CDMA, GSM Frame Structure, GSM channel Types, cellular concepts, handoff strategies, Frequency reuse and GSM call structure.
This PDF provides a in-depth explanation for all the concepts and practices used before.
55 Different Types of Antennas With Examples Used in Wireless Communication.pdfAntenna Manufacturer Coco
After the read about these 55 different types of antennas, you will learn about the different types of antennas with examples and their use.
As an important part of wireless communication systems, the antenna plays an irreplaceable role. In our life, there are many types of wireless communication requirements, such as long-distance wireless communication, short-distance wireless communication, satellite wireless communication, microwave wireless communication, cell phone wireless communication, point-to-point wireless communication, point-to-face wireless communication, and so on.
Different wireless communications requirements correspond to the use of different types of antenna wireless communication frequency bands, and different wireless communication systems, so it is necessary to use different types of antennas.
The design and selection of different types of antennas are an important part of designing a wireless transceiver for RF systems. A good RF wireless antenna system can make the communication distance the best state. The size of the same type of antenna is proportional to the wavelength of the RF signal. The lower the signal frequency, the larger the antenna needed.
Statement of Operations and Financial StatementsSubmit written r.docxwhitneyleman54422
Statement of Operations and Financial Statements
Submit written responses to these questions.
This assignment needs to be in APA style, plagiarism free, and each to understand.
1. List several efforts that have been enacted by payors to control costs.
2. Explain the ramifications of allowing/disallowing an individual to be able to sue his or her HMO.
3. What are each of the financial statements commonly called in for-profit health care organizations and in not for-profit care organizations?
The following questions relate to the statement of operations of not for-profit health care organizations.
1. What is the analogous for-profit statement called? What are the main sections of the statement of operations?
2. What are revenues, gains, and other support?
3. What are expenses and losses?
4. Funds released from restricted net assets to unrestricted net assets are presented in what section of the statement of revenue, expenses and other activities?
The following questions relate to the statement of changes in net assets.
1. What is the traditional name for this statement?
2. What is the purpose of this statement?
3. What are the main sections of this statement?
4. Discuss the difference between permanently restricted and temporarily restricted net assets.
The following questions relate to the statement of cash flows of a not-profit health care organization.
1. What are its main sections?
2. What is the purpose of this statement?
3. Where in the financial statements would there be important explanatory information?
4. In what financial statement would one identify the purchase of long-term investments?
5. How does the accrual basis of accounting differ from the cash basis of accounting?
1
Foundations of Technical Programming
ASSIGNMENT (25%)
Q.1 Computers are often used for data analysis to compile and analyze the results of
surveys and opinion polls. You are asked to write a complete C program to use array
response initialized with 99 responses to a survey. Each response is a number from
1 to 9. The program computes the mean, median and mode of the 99 values. In your
program, you need to
(i) Define a function mean() to compute the mean by totalling 99 elements and
dividing the result by 99.
(ii) Define a function median(), to determine the median, that sorts the array of
responses into ascending order, then picking the middle element of the
sorted array.
(iii) Define a function mode() to determine the mode by counting the number of
responses of each type then selecting the value with the greatest count.
(iv) Print out the responses, frequencies and the corresponding histogram.
The following shows the sample run of your program:
The unsorted array of responses is
7875616546578352447
87987869874649352765
35798989872989787876
98798989877878939876
87878959879898789876
The sorted array is
9999999999999999999
88888888888888888888
88888887777777777777
77777777776666666665
55555554444433332.
Md university cmis 102 week 4 hands on lab newLast7693
cmis 102 homework 4 create your own function new,cmis 102 week 4 hands on lab new,cmis 102 stage 4 final system report precision electronic parts new,md university cmis 102,cmis 102,md university cmis 102 week 4 tutorial,cmis 102 week 4 assignment,md university cmis 102 week 4 help
Md university cmis 102 week 4 hands on lab newscottbrownnn
cmis 102 homework 4 create your own function new,cmis 102 week 4 hands on lab new,cmis 102 stage 4 final system report precision electronic parts new,md university cmis 102,cmis 102,md university cmis 102 week 4 tutorial,cmis 102 week 4 assignment,md university cmis 102 week 4 help
Md university cmis 102 week 4 hands on lab neweyavagal
cmis 102 homework 4 create your own function new,cmis 102 week 4 hands on lab new,cmis 102 stage 4 final system report precision electronic parts new,md university cmis 102,cmis 102,md university cmis 102 week 4 tutorial,cmis 102 week 4 assignment,md university cmis 102 week 4 help
Hi, I’m Dr. Jilesh !A professional spell caster,
– Expert in Hoodoo / conjure works, Angelic Healer (Academy of Ancient Magick)
-Tarot Reader, Psychotherapist, Reiki Grand Master 9th degree (Authorized instructor and trainer)
Check this link
programming for programs solving using C languagesushma chinta
practice programs in C, swap two numbers, sum of the digits of a three digit number, simple interest, compound interest, convert the temperature in Fahrenheit to degrees Celsius , program to convert a given integer (in days) to years, months and days, assumes that all months have 30 days and all years have 365 days, Income Calculation, Compute Gain Percentage,Display Characters
BTE 320-498 Summer 2017 Take Home Exam (200 poi.docxAASTHA76
BTE 320-498/ Summer 2017
Take Home Exam
(200 points)
Due 6/30/2017 – 11:59pm (No extensions)
Presentation in class Friday June 30 at 5:30 PM
Required Part
1. (a) Explain in English what the following function will do. Explain how it works.
(b) What will be the output if the following calls are made:
whoknows(2) =
whoknows(15) =
whoknows(-3) =
(c) Write a function digitize (using loops) that takes two parameters: one integer
parameter and one bool parameter. The function would print the integer one digit
at a time each on a separate line. If the bool parameter passed were true, the
function would print the digits from the most significant digit to the least
significant. Otherwise, it would print it in the reverse order (least significant to
most significant).
Function Call Output
digitize(1758,true) 1
7
5
8
digitize(1758,false) 8
5
7
1
(d) Write a function (without using loops) that reverses the digits in an integer
and prints out the integer in this reverse form. It is not necessary to calculate the
value of the reverse integer, just print out the digits in reverse order. The function
should be called reverse. Remember to explain your functions, either by adding
comments or using pseudocode or showing how you derived the function. State
any assumptions you make.
2. (a) Write a function, printdivisors, that takes a single integer parameter and prints
all the numbers less that the parameter that are divisors of the parameter (i.e.
divides it without a remainder) including 1. So printdivisors(6) will print 1,2,3.
Note you may use a wrapper function or default parameters.
(b) Write a function, sumdivisors, that takes a single integer parameter and returns
the sum of all the divisors of the parameter (including 1). So sumdivisors(6) will
return 6 as 1+2+3=6. Note you may use a wrapper function or default parameters.
(c) Write a function, allperfects, that takes two parameters, each an integer, in any
order and prints out all the perfect numbers between the lower parameter and the
higher parameter. A perfect number is one is which the sum of its divisors is equal
to the number itself.
Remember to explain your functions, either by adding comments or showing how
you derived the function. State any assumptions you make.
3. (a) Write a recursive function, printZeros, which prints out a series of zeros. The
function takes one parameter and prints out the number of zeros specified by the
parameter. So printZeros(4) will print: 0000 and printZeros(2) will print 00.
(b) Write a recursive function, printZPattern, which prints out a pattern of zeros
as follows:
printZPattern(3) outputs:
000
printZPattern(1) outputs:
0
printZPattern(4) outputs:
0000
00 000
0 00
0
(c) How would you modify your second function to print a mirror pattern, such as
(you do not have to code this one, just explain):
printZPattern2(3) outputs:
000
00
0
00
000
Re ...
Similar to C - Programming Assignment 1 and 2 (20)
Representational State Transfer (REST)
IaaS and Hybrid Cloud
Orchestration & Virtualization: Eucalyptus & Amazon
Content Delivery Network (CDN): Facebook and Akamai
PaaS and Container as a Service (CaaS)
PaaS: Google App Engine (GAE) and Ruby on Rails
CaaS: DockerHub
SaaS and Distributed Version Control (DVC)
SaaS: Facebook Testing (Infer and Sapienz)
DVC: GitHub and Git-LFS
Cloud Security and Privacy policies
NIST Guidelines, GDPR, CDN Security
Representational State Transfer (REST)
IaaS and Hybrid Cloud
Orchestration & Virtualization: Eucalyptus & Amazon
Content Delivery Network (CDN): Facebook and Akamai
PaaS and Container as a Service (CaaS)
PaaS: Google App Engine (GAE) and Ruby on Rails
CaaS: DockerHub
SaaS and Distributed Version Control (DVC)
SaaS: Facebook Testing (Infer and Sapienz)
DVC: GitHub and Git-LFS
Cloud Security and Privacy policies
NIST Guidelines, GDPR, CDN Security
Cloud Service Life-Cycle
Cloud Deployment Scenarios
Cloud Service Development and Testing
Web Service Slicing for Regression Testing of Services
Cloud Service Evolution Analytics
Quality of Service and Service Level Agreement
System of Systems Engineering (SoSE),
System “ilities” (Reliability, Availability, Maintainability, and Changeability),
State Series,
System Evolution Analytics,
System Network Evolution Rules,
System Network Complexity,
System Evolution Recommender
Service Evolution Analytics
P, NP, NP-Complete, and NP-Hard
Reductionism in Algorithms
NP-Completeness and Cooks Theorem
NP-Complete and NP-Hard Problems
Travelling Salesman Problem (TSP)
Travelling Salesman Problem (TSP) - Approximation Algorithms
PRIMES is in P - (A hope for NP problems in P)
Millennium Problems
Conclusions
Systems Analysis,
Systems Design,
Systems Modelling,
Systems Architecture,
System Development and Testing,
System Maintenance and Evolution,
SDLC example (Cloud Service life cycle)
Requirements Engineering,
Functional and Non-Functional Requirements,
Engineering Design Process and Process Engineering,
Logistics Management,
Risk management, and
Requirements specification
Complex systems,
Software systems,
Database systems,
Operating systems,
Bioinformatics systems,
Social Systems,
Service Oriented Systems,
Cloud Systems,
Ubiquitous systems,
Distributed Version Control Systems (GitHub), and
Software Container Systems (DockerHub and Google App Engine).
Interdisciplinary Science, Engineering, and Management,
Systems theory,
Systems thinking,
System development life cycles,
Synergy,
Project management,
Engineering Domains (Industry 4.0) , and
Communities (INCOSE and IEEE SMC Society).
1. Big Data Analytics
- Big Data
- Spark: Big Data Analytics
- Resilient Distributed Datasets (RDD)
- Spark libraries (SQL, DataFrames, MLlib for machine learning, GraphX, and Streaming)
- PFP: Parallel FP-Growth
2. Ubiquitous Computing
- Edge Computing
- Cloudlet
- Fog computing
- Internet of Things (IoT)
- Virtualization
- Virtual Conferencing
- Virtual Events (2D, 3D, and Hybrid)
1. Representational State Transfer (REST)
2. IaaS and Hybrid Cloud
- Orchestration & Virtualization: Eucalyptus & Amazon
- Content Delivery Network (CDN): Facebook and Akamai
3. PaaS and Container as a Service (CaaS)
- PaaS: Google App Engine (GAE) and Ruby on Rails
- CaaS: DockerHub
4. SaaS and Distributed Version Control (DVC)
- SaaS: Facebook Testing (Infer and Sapienz)
- DVC: GitHub and Git-LFS
5. Cloud Security and Privacy policies
- NIST Guidelines, GDPR, and CDN Security
1. Cloud Life-Cycle
2. Cloud Deployment Scenario
3. Cloud Service Development and Testing
4. Web Service Slicing for Regression Testing of Services
5. Cloud Service Evolution Analytics
6. Quality of Service and Service Level Agreement
Connector Corner: Automate dynamic content and events by pushing a buttonDianaGray10
Here is something new! In our next Connector Corner webinar, we will demonstrate how you can use a single workflow to:
Create a campaign using Mailchimp with merge tags/fields
Send an interactive Slack channel message (using buttons)
Have the message received by managers and peers along with a test email for review
But there’s more:
In a second workflow supporting the same use case, you’ll see:
Your campaign sent to target colleagues for approval
If the “Approve” button is clicked, a Jira/Zendesk ticket is created for the marketing design team
But—if the “Reject” button is pushed, colleagues will be alerted via Slack message
Join us to learn more about this new, human-in-the-loop capability, brought to you by Integration Service connectors.
And...
Speakers:
Akshay Agnihotri, Product Manager
Charlie Greenberg, Host
Let's dive deeper into the world of ODC! Ricardo Alves (OutSystems) will join us to tell all about the new Data Fabric. After that, Sezen de Bruijn (OutSystems) will get into the details on how to best design a sturdy architecture within ODC.
PHP Frameworks: I want to break free (IPC Berlin 2024)Ralf Eggert
In this presentation, we examine the challenges and limitations of relying too heavily on PHP frameworks in web development. We discuss the history of PHP and its frameworks to understand how this dependence has evolved. The focus will be on providing concrete tips and strategies to reduce reliance on these frameworks, based on real-world examples and practical considerations. The goal is to equip developers with the skills and knowledge to create more flexible and future-proof web applications. We'll explore the importance of maintaining autonomy in a rapidly changing tech landscape and how to make informed decisions in PHP development.
This talk is aimed at encouraging a more independent approach to using PHP frameworks, moving towards a more flexible and future-proof approach to PHP development.
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
"Impact of front-end architecture on development cost", Viktor TurskyiFwdays
I have heard many times that architecture is not important for the front-end. Also, many times I have seen how developers implement features on the front-end just following the standard rules for a framework and think that this is enough to successfully launch the project, and then the project fails. How to prevent this and what approach to choose? I have launched dozens of complex projects and during the talk we will analyze which approaches have worked for me and which have not.
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...DanBrown980551
Do you want to learn how to model and simulate an electrical network from scratch in under an hour?
Then welcome to this PowSyBl workshop, hosted by Rte, the French Transmission System Operator (TSO)!
During the webinar, you will discover the PowSyBl ecosystem as well as handle and study an electrical network through an interactive Python notebook.
PowSyBl is an open source project hosted by LF Energy, which offers a comprehensive set of features for electrical grid modelling and simulation. Among other advanced features, PowSyBl provides:
- A fully editable and extendable library for grid component modelling;
- Visualization tools to display your network;
- Grid simulation tools, such as power flows, security analyses (with or without remedial actions) and sensitivity analyses;
The framework is mostly written in Java, with a Python binding so that Python developers can access PowSyBl functionalities as well.
What you will learn during the webinar:
- For beginners: discover PowSyBl's functionalities through a quick general presentation and the notebook, without needing any expert coding skills;
- For advanced developers: master the skills to efficiently apply PowSyBl functionalities to your real-world scenarios.
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Tobias Schneck
As AI technology is pushing into IT I was wondering myself, as an “infrastructure container kubernetes guy”, how get this fancy AI technology get managed from an infrastructure operational view? Is it possible to apply our lovely cloud native principals as well? What benefit’s both technologies could bring to each other?
Let me take this questions and provide you a short journey through existing deployment models and use cases for AI software. On practical examples, we discuss what cloud/on-premise strategy we may need for applying it to our own infrastructure to get it to work from an enterprise perspective. I want to give an overview about infrastructure requirements and technologies, what could be beneficial or limiting your AI use cases in an enterprise environment. An interactive Demo will give you some insides, what approaches I got already working for real.
DevOps and Testing slides at DASA ConnectKari Kakkonen
My and Rik Marselis slides at 30.5.2024 DASA Connect conference. We discuss about what is testing, then what is agile testing and finally what is Testing in DevOps. Finally we had lovely workshop with the participants trying to find out different ways to think about quality and testing in different parts of the DevOps infinity loop.
Neuro-symbolic is not enough, we need neuro-*semantic*Frank van Harmelen
Neuro-symbolic (NeSy) AI is on the rise. However, simply machine learning on just any symbolic structure is not sufficient to really harvest the gains of NeSy. These will only be gained when the symbolic structures have an actual semantics. I give an operational definition of semantics as “predictable inference”.
All of this illustrated with link prediction over knowledge graphs, but the argument is general.
Search and Society: Reimagining Information Access for Radical FuturesBhaskar Mitra
The field of Information retrieval (IR) is currently undergoing a transformative shift, at least partly due to the emerging applications of generative AI to information access. In this talk, we will deliberate on the sociotechnical implications of generative AI for information access. We will argue that there is both a critical necessity and an exciting opportunity for the IR community to re-center our research agendas on societal needs while dismantling the artificial separation between the work on fairness, accountability, transparency, and ethics in IR and the rest of IR research. Instead of adopting a reactionary strategy of trying to mitigate potential social harms from emerging technologies, the community should aim to proactively set the research agenda for the kinds of systems we should build inspired by diverse explicitly stated sociotechnical imaginaries. The sociotechnical imaginaries that underpin the design and development of information access technologies needs to be explicitly articulated, and we need to develop theories of change in context of these diverse perspectives. Our guiding future imaginaries must be informed by other academic fields, such as democratic theory and critical theory, and should be co-developed with social science scholars, legal scholars, civil rights and social justice activists, and artists, among others.
State of ICS and IoT Cyber Threat Landscape Report 2024 previewPrayukth K V
The IoT and OT threat landscape report has been prepared by the Threat Research Team at Sectrio using data from Sectrio, cyber threat intelligence farming facilities spread across over 85 cities around the world. In addition, Sectrio also runs AI-based advanced threat and payload engagement facilities that serve as sinks to attract and engage sophisticated threat actors, and newer malware including new variants and latent threats that are at an earlier stage of development.
The latest edition of the OT/ICS and IoT security Threat Landscape Report 2024 also covers:
State of global ICS asset and network exposure
Sectoral targets and attacks as well as the cost of ransom
Global APT activity, AI usage, actor and tactic profiles, and implications
Rise in volumes of AI-powered cyberattacks
Major cyber events in 2024
Malware and malicious payload trends
Cyberattack types and targets
Vulnerability exploit attempts on CVEs
Attacks on counties – USA
Expansion of bot farms – how, where, and why
In-depth analysis of the cyber threat landscape across North America, South America, Europe, APAC, and the Middle East
Why are attacks on smart factories rising?
Cyber risk predictions
Axis of attacks – Europe
Systemic attacks in the Middle East
Download the full report from here:
https://sectrio.com/resources/ot-threat-landscape-reports/sectrio-releases-ot-ics-and-iot-security-threat-landscape-report-2024/
1. Lab Assignment 1: Introduction to C Programming
CS-153 Computer Programming Lab
Autumn Semester, 2016, IIT Indore
Date: 01-08-16
Introduction to #include, printf, scanf, variables, expression, if statement, if else statement, main(),
return() and data types: integer, float, and char. Introduction to programming standards: Line length
limit, Comments, Variable names, Indentation, Braces, Position of main ( ), Declarations, Position of
variable declarations.
Note: Write following programs in C language. Also note that this assignment will be evaluated by
TA’s in the upcoming labs of next week (08-08-16 onward) for each batch.
1. Write a program to print “Hello World” on screen.
2. Write a program to input two integers and print their sum.
3. Write a program to input length and breadth of a rectangle. Calculate and print area and perimeter of
the rectangle.
4. Write a program to input a number and print whether it is odd or even.
5. Write a program to input a 5-digit integer through keyboard, and obtain the reverse number. Print
whether the original and reverse numbers are equal or not. If not, print the greater one.
6. If cost price and selling price of an item is input through the keyboard, write a program to determine
whether the seller has made profit or incurred loss. Also determine how much profit he made or loss
he incurred.
7. If the ages of Ram, Shyam and Ajay are input through the keyboard, write a program to determine the
youngest of the three.
8. Write a program to find the greatest of the three numbers entered through the keyboard using
conditional operators.
9. Write a program to find the value of one number raised to the power of another.
10. Write a program to print all the ASCII values and their equivalent characters using a while loop. The
ASCII values vary from 0 to 255.
2. Lab Assignment 2: Loops, Case Control and Array: C Programming
CS-153 Computer Programming Lab
Autumn Semester, 2016, IIT Indore
Date: 09-08-16
Note: Write following programs in C language. Also note that this assignment will be evaluated by
TA’s in the upcoming labs of next week (15-08-16 onward) for each batch.
1. Write a program to compute an integer y such that y is produced by reversing x (using loop). For
example, if x is 6787, y is 7876, and if x is 80, y is 8.
2. Fibonacci numbers are the numbers in the following integer sequence: 0,1,1,2,3,5,8,13,21... By
definition, the first two Fibonacci numbers are 0 and 1, and each subsequent number is the sum of the
previous two numbers. Write a program (using loop) to compute nth number in this series for given
input n.
3. Write a menu driven program (using switch case) which has following options:
1. Factorial of a number.
2. Prime or not
3. Odd or even
4. Exit
4. Write a program to find average marks (using array) obtained by a class of 30 students in a test.
5. Write a program to find out the frequency of occurrence of a given value v inside an array of size N.
Read N, the actual numbers in the array, and value v from the keyboard before you compute the
frequency.
6. Given an array of integers of size n, find out if the numbers in the array appear in a palindrome order.
A palindrome is a sequence that reads the same when you flip it. For example, 121 is a palindrome, 3
is a palindrome, and 234432 is also a palindrome
3. Practice Set 1: Introduction to C Programming
CS-153 Computer Programming Lab
Autumn Semester, 2016, IIT-Indore
A control statement determines whether other statements will be executed or not. Example of control
statements are if statement, loop statements (while, do-while and for) and switch statement.
Section 1: if, if-else, nested if-else
1. Given the length and breadth of a rectangle, write a program to find whether the area of the
rectangle is greater than its perimeter. For example, the area of the rectangle with length = 5 and
breadth = 4 is greater than its perimeter. Given three points (x1, y1), (x2, y2) and (x3, y3), write a
program to check if all the three points fall on one straight line.
2. Given the coordinates (x, y) of a center of a circle and it’s radius, write a program which will
determine whether a point lies inside the circle, on the circle or outside the circle.
(Hint: Use sqrt( ) and pow( ) functions).
3. Any character is entered through the keyboard; write a program to determine whether the
character entered is a capital letter, a small case letter, a digit or a special symbol. The following
table shows the range of ASCII values for various characters.
Characters ASCII Values
A – Z 65 – 90
a – z 97 – 122
0 – 9 48 – 57
special symbols 0 - 47, 58 - 64, 91 - 96, 123 – 127
4. An Insurance company follows following rules to calculate premium.
a. If a person’s health is excellent and the person is between 25 and 35 years of age and lives in a
city and is a male then the premium is Rs. 4 per thousand and his policy amount cannot exceed
Rs. 2 lakhs.
b. If a person satisfies all the above conditions except that the sex is female then the premium is
Rs. 3 per thousand and her policy amount cannot exceed Rs. 1 lakh.
c. If a person’s health is poor and the person is between 25 and 35 years of age and lives in a
village and is a male then the premium is Rs. 6 per thousand and his policy cannot exceed Rs.
10,000.
d. In all other cases the person is not insured.
Write a program to output whether the person should be insured or not, his/her premium
rate and maximum amount for which he/she can be insured.
5. A certain grade of steel is graded according to the following conditions:
a. Hardness must be greater than 50
b. Carbon content must be less than 0.7
4. c. Tensile strength must be greater than 5600
The grades are as follows:
Grade is 10 if all three conditions are met
Grade is 9 if conditions (i) and (ii) are met
Grade is 8 if conditions (ii) and (iii) are met
Grade is 7 if conditions (i) and (iii) are met
Grade is 6 if only one condition is met
Grade is 5 if none of the conditions are met
Write a program, which will require the user to give values of hardness, carbon content
and tensile strength of the steel under consideration and output the grade of the steel.
6. A library charges a fine for every book returned late. For first 5 days the fine is 50 paise, for 6-10
days fine is one rupee and above 10 days fine is 5 rupees. If you return the book after 30 days
your membership will be cancelled. Write a program to accept the number of days the member is
late to return the book and display the fine or the appropriate message.
7. If the three sides of a triangle are entered through the keyboard, write a program to check whether
the triangle is isosceles, equilateral, scalene or right angled triangle.
8. In a company, worker efficiency is determined on the basis of the time required for a worker to
complete a particular job. If the time taken by the worker is between 2–3 hours, then the worker is
said to be highly efficient. If the time required by the worker is between 3–4 hours, then the
worker is ordered to improve speed. If the time taken is between 4–5 hours, the worker is given
training to improve his speed, and if the time taken by the worker is more than 5 hours, then the
worker has to leave the company. If the time taken by worker is input through the keyboard, find
the efficiency of the worker.
9. A university has the following rules for a student to qualify for a degree with A as the main
subject and B as the subsidiary subject:
a. He should get 55 percent or more in A and 45 percent or more in B.
b. If he gets than 55 percent in A, he should get 55 percent or more in B. However, he should get
at least 45 percent in A.
c. If he gets less than 45 percent in B and 65 percent or more in A, he is allowed to reappear in an
examination in B to qualify.
d. In all other cases he is declared to have failed. Write a program to receive marks in A and B
and Output whether the student has passed, failed or is allowed to reappear in B.
10. Policy followed by a company to process customer orders is given by the following rules:
a. If a customer order is less than or equal to that in stock and has credit is OK, supply has
requirement.
b. If has credit is not OK do not supply. Send him intimation.
c. If has credit is Ok but the item in stock is less than has order, supply what is in stock. Intimate
to him data the balance will be shipped.
Write a C program to implement the company policy.
Reference: Questions are taken from “Let us C” by Yashwant Kanetkar
5. Section 2: Conditional operators (? :) is a ternary operator which takes three operands
1. What would be the output of the following programs:
(a) main() {
int i = -4, j, num;
j = (num < 0 ? 0 : num * num);
printf("n%d", j);
}
(b) main() {
int k, num = 30;
k = (num > 5 ? (num <= 10 ? 100 : 200) : 500);
printf("n%d", num);
}
(c) main() {
int j = 4;
(!j != 1 ? printf("nWelcome") : printf("nGood Bye"));
}
2. Rewrite the following programs using conditional operators.
(a) main() {
int x, min, max;
scanf("n%d %d", & max, & x);
if (x > max) {
max = x;
} else {
min = x;
}
}
(b) main() {
int code;
scanf("%d", & code);
if (code > 1) {
printf("nJerusalem");
} else if (code < 1) {
printf("nEddie");
} else {
printf("nC Brain");
}
}
6. (c) main() {
float sal;
printf("Enter the salary");
scanf("%f", & sal);
if (sal < 40000 && sal > 25000) {
printf("Manager");
} else {
if (sal < 25000 && sal > 15000) {
printf("Accountant");
} else { printf("Clerk");
}
}
}
3. Using conditional operators determine:
a. Whether the character entered through the keyboard is a lower case alphabet or not.
b. Whether a character entered through the keyboard is a special symbol or not.
4. Write a program using conditional operators to determine whether a year entered through the
keyboard is a leap year or not.
Reference: Questions are taken from “Let us C” by Yashwant Kanetkar
7. Section 3: for and/or while
1. Write a program to calculate overtime pay of 10 employees. Overtime is paid at the rate of Rs.
12.00 per hour for every hour worked above 40 hours. Assume that employees do not work for
fractional part of an hour.
2. Write a program to find the factorial value of any number entered through the keyboard. Two
numbers are entered through the keyboard.
3. Write a program to find the value of one number raised to the power of another.
4. Write a program to print all the ASCII values and their equivalent characters using a while loop.
The ASCII values vary from 0 to 255.
Section 4: loop that needs do-while, break and/or continue
1. An expression contains relational operators, assignment operators, and arithmetic operators. In
the absence of parentheses, they will be evaluated in which of the following order:
1. assignment, relational, arithmetic
2. arithmetic, relational, assignment
3. relational, arithmetic, assignment
4. assignment, arithmetic, relational
2. The break statement is used to exit from:
1. an if statement
2. a for loop
3. a program
4. the main( ) function
3. A do-while loop is useful when we want that the statements within the loop must be executed:
1. Only once
2. At least once
3. More than once
4. None of the above
4. In what sequence the initialization, testing and execution of body is done in a do-while loop
1. Initialization, execution of body, testing
2. Execution of body, initialization, testing
3. Initialization, testing, execution of body
4. None of the above.
5. Write a program to print all prime numbers from 1 to 300. (Hint: Use nested loops, break and
continue)
6. Write a program to fill the entire screen with a smiling face. Smiling face has an ASCII value 1.
Reference: Questions are taken from “Let us C” by Yashwant Kanetkar
8. #include <stdio.h>
int main()
{
int num = 6787;
int rev_num = 0;
while(num > 0)
{
rev_num = rev_num*10 + num%10;
num = num/10;
}
printf("Reverse of no. is %d", rev_num);
getchar();
return 0;
}
9. /*
* C program to generate and print first N FIBONACCI numbers
* in the series.
*/
#include <stdio.h>
void main()
{
int fib1 = 0, fib2 = 1, fib3, num, count = 0;
printf("Enter the value of num n");
scanf("%d", &num);
printf("First %d FIBONACCI numbers are ...n", num);
printf("%dn", fib1);
printf("%dn", fib2);
count = 2; /* fib1 and fib2 are already used */
while (count < num)
{
fib3 = fib1 + fib2;
count++;
printf("%dn", fib3);
fib1 = fib2;
fib2 = fib3;
}
}
10. main( )
{
int choice ;
while ( 1 )
{
printf ( "n1. Factorial" ) ;
printf ( "n2. Prime" ) ;
printf ( "n3. Odd/Even" ) ;
printf ( "n4. Exit" ) ;
printf ( "nYour choice? " ) ;
scanf ( "%d", &choice ) ;
switch ( choice )
{
case 1 :
/* logic for factorial of a number */
break ;
case 2 :
/* logic for deciding prime number */
break ;
case 3 :
/* logic for odd/even */
break ;
case 4 :
exit( ) ;
}
}
}
11. #include<stdio.h>
main( )
{
int avg, sum = 0 ;
int i ;
int marks[30] ; /* array declaration */
for ( i = 0 ; i <= 29 ; i++)
{
printf ( "nEnter marks " ) ;
scanf ( "%d", &marks[i] ) ; /* store data in array */
}
for ( i = 0 ; i <= 29 ; i++ )
sum = sum + marks[i] ; /* read data from an array*/
avg = sum / 30 ;
printf ( "nAverage marks = %d", avg ) ;
}
12. #include<stdio.h>
int main()
{
int array[];
int i, N, v, frequency=0;
printf("Enter the size of the arrayn");
scanf("%d",&N);
printf("Enter %d numbersn", N);
for(i=0;i<N;i++)
{
scanf("%d",&array[i]);
}
printf("Enter the value for which frequency is to be computedn");
scanf("%d", &v);
for(i=0; i<N; i++)
{
if(array[i]==v)
{
frequency++;
}
}
printf("The frequency is %d", frequency);
}
13. #include<stdio.h>
#include<conio.h>
int main()
{
int n, reverse = 0, temp;
printf("Enter a number to check if it is a palindrome or notn");
scanf("%d",&n);
temp = n;
while( temp != 0 ) // temp is descreases with least significant digit.
{
reverse = reverse * 10; // reverse is multiplied with 10.
reverse = reverse + temp%10; // find out the least significant digit to add with
the reverse. Store the value in reverse again.
temp = temp/10; // temp is descreased with a least significant digit.
}
if ( n == reverse ) // if given number n is equal to reverse then
palindrome otherwise not.
printf("%d is a palindrome number.n", n);
else
printf("%d is not a palindrome number.n", n);
getch();
return 0;
}