SlideShare a Scribd company logo
1 of 24
--- PROBLEM DESCRIPTION - M2P1 - 4 - Splitting into Teams ---
Splitting into Teams
During the Physical Education hour, PT sir has decided to conduct some team games. He wants to split the
students in the class into equal sized teams.
In some cases, there may be some students who are left out from teams and he wanted to use the left out
students to assist him in conducting the team games.
For instance, if there are 50 students in the class and if the class has to be divided into 7 equal sized teams,
7 students will be there in each team and 1 student will be left out.
PT sir asks your help to automate this team splitting task. Can you please help him out?
Input Format:
Input consists of 2 integers. The first integer corresponds to the number of students in the class and the
second integer corresponds to the number of teams.
Output Format:
Refer sample input and output for formatting specifications.
Sample Input and Output:
[All text in bold corresponds to input and the rest corresponds to output]
Number of students:
60
Number of teams:
8
The number of students in each team is 7 and left out is 4
-----------------------------------------------------------------------------------------------------------------------
--- ALGORITHM - M2P1 - 4 - Splitting into Teams ---
Step 1: Start the program.
Step 2: Read the number of students [a] and number of teams [b] as from the user.
Step 3: Use a/b to calculate the number of students in each team and a % b to calculate the left out students.
Step 4: Display the result to the user
Step 5: Stop the program
-----------------------------------------------------------------------------------------------------------------------
--- FLOWCHART - M2P1 - 4 - Splitting into Teams ---
--- PROGRAM - M2P1 - 4 - Splitting into Teams---
# include <stdio.h>
int main()
{
int n, t;
printf(" Number of students :n");
scanf("%d", &n);
printf("Number of teams:n");
scanf("%d", &t);
int m, l;
m = n / t;
l = n % t;
printf("The number of students in each team is %d and left out is %d", m, l);
return 0;
}
-----------------------------------------------------------------------------------------------------------------------
Result:
Thus the C Program for splitting the number of students into team was executed and verified
successfully.
--- PROBLEM DESCRIPTION - Odd or Even using Bitwise and Operator ---
Odd or Even using Bitwise and Operator
Write a C program to find whether the given number is odd or even, using Bitwise ' & ' Operator.
Input Format:
The input consists of an integer.
Output Format:
Output should display whether the input is Odd or Even.
Refersample input and output for formatting specifications.
[All text in bold corresponds to input and the rest corresponds to output]
Sample Input and Output 1:
Enter the number :
5
Odd
Sample Input and Output 2:
Enter the number :
8
Even
-----------------------------------------------------------------------------------------------------------------------
--- ALGORITHM - Odd or even using Bitwise and Operator ---
Step 1: Start the process.
Step 2: Declare and get the values for a,b,c.
Step 3: Use n & 1 to check whether the given number is odd or even
Step 4: Display the result to the user
Step 5: Stop the program
-----------------------------------------------------------------------------------------------------------------------
--- FLOWCHART - Odd or even using Bitwise and Operator ---
--- PROGRAM - Odd or even using Bitwise and Operator---
# include <stdio.h>
int main()
{
int a;
printf("Enter the number :n");
scanf("%d", &a);
(a & 1) ? printf("Odd n") : printf("Even n");
return 0;
}
-----------------------------------------------------------------------------------------------------------------------
Result:
Thus the C Program for finding whether the given number is odd or even using bitwise operator was
executed and verified successfully.
--- PROBLEM DESCRIPTION - Largest of three numbers using Ternary Operator ---
Largest of three numbers using Ternary Operator
Write a program to find greatest of three numbers, using Ternary Operator.
Input Format:
The input consists of 3 integers.
Output Format:
Output should display the greatest of the 3 numbers.
Refersample input and output for formatting specifications.
[All text in bold corresponds to input and the rest corresponds to output]
Sample Input and Output 1:
Enter the numbers:
5
8
2
8 is the greatest number
Sample Input and Output 2:
Enter the numbers:
44
16
23
44 is the greatest number
-----------------------------------------------------------------------------------------------------------------------
--- ALGORITHM - Largest of three numbers using Ternary Operator ---
Step 1: Start the process.
Step 2: Initialize variables a,b,c and d. Get the values of a,b,c from user.
Step 3: Using ternary operator find the greatest among 3 numbers and store the value in
big.
Step 4: Display the value of big.
Step 5: Stop the process.
-----------------------------------------------------------------------------------------------------------------------
--- FLOWCHART - Largest of three numbers using Ternary Operator ---
--- PROGRAM - Largest of three numbers using Ternary Operator---
# include <stdio.h>
int main()
{
int a, b, c;
printf("Enter the numbers:n");
scanf("%d %d %d", &a, &b, &c);
int big;
big = (a > b) ? ((a > c) ? a : c) : ((b > c) ? b : c);
printf("%d is the greatest number", big);
return 0;
}
-----------------------------------------------------------------------------------------------------------------------
Result:
Thus the C Program for finding largest of three numbers using ternary operator was executed and
verified successfully.
--- PROBLEM DESCRIPTION - M2P2 - 7 - THREE IDIOTS ---
THREE IDIOTS
Ajay, Binoy and Chandru were very close friends at school. They were very good in Mathematics and they
were the pet students of Emily Mam. Their gang was known as 3-idiots. Ajay, Binoy and Chandru live in
the same locality.
A new student Dinesh joins their class and he wanted to be friends with them. He asked Binoy about his
house address. Binoy wanted to test Dinesh's mathematical skills. Binoy told Dinesh that his house is at the
midpoint of the line joining Ajay's house and Chandru's house. Dinesh was puzzled. Can you help Dinesh
out?
Given the coordinates of the 2 end points of a line (x1,y1) and (x2,y2), write a program to find the midpoint
of the line.
Input Format:
Input consists of 4 integers. The first integer corresponds to x1 . The second integer corresponds to y1. The
third and fouth integers correspond to x2 and y2 respectively.
Output Format:
Refer Sample Input and Output for exact formatting
specifications. [All floating point values are displayed
correct to 1 decimal place] Sample Input and Output:
[All text in bold corresponds to input and the rest corresponds to output]
X1
2
Y1
4
X2
10
Y2
15
Binoy's house is located at (6.0,9.5)
-----------------------------------------------------------------------------------------------------------------------
--- ALGORITHM - M2P2 - 7 - THREE IDIOTS ---
Step 1:Start the process.
Step 2:Declare and get the values for x1,y1,x2,y2.
Step 3:Declare and calculate x3=(x1+x2)/2 and y3=(y1+y2)/2.
Step 4:Display the result.
Step 5:Stop the process.
-----------------------------------------------------------------------------------------------------------------------
--- FLOWCHART - M2P2 - 7 - THREE IDIOTS ---
--- PROGRAM - M2P2 - 7 - THREE IDIOTS---
#include<stdio.h>
int main()
{
int x1, x2, y1, y2;
char c1 = '(';
char c2 = ')';
printf("X1n");
scanf("%d", &x1);
printf("Y1n");
scanf("%d", &y1);
printf("X2n");
scanf("%d", &x2);
printf("Y2n");
scanf("%d", &y2);
float x3 = ((x1 + x2) / 2.0);
float y3 = ((y1 + y2) / 2.0);
printf("Binoy's house is located at %c%.1f,%.1f%c", c1, x3, y3, c2);
return 0;
}
-----------------------------------------------------------------------------------------------------------------------
Result:
Thus the C Program for finding distance between two points was executed and verified successfully.
--- PROBLEM DESCRIPTION - Celsius to Fahrenheit Converter ---
Celsius to Fahrenheit Converter
The relatioship between Celsius (C) and Fahrenheit (F) degrees for measuring temperature is linear.
Find an equation relating C and F if 0 C corresponds to 32 F and 100 C corresponds to 212 F.
Write a program to simulate Celsius to Fahrenheit Converter.
Input Format:
Input consists of a single integer which corresponds to a measure of temparature in Celcius.
Output Format:
Refer Sample Input and Output for exact formatting
specifications. [All floating point values are displayed
correct to 1 decimal place]
Sample Input and Output:
[All text in bold corresponds to input and the rest corresponds to output]
Temparature in Celsius:
12
Temparature in Fahrenheit is 53.6F
-----------------------------------------------------------------------------------------------------------------------
--- ALGORITHM - Celsius to Fahrenheit Converter ---
Step 1: Start the process.
Step 2: Initialize c and f.
Step 3: Get the value of c from the user.
Step 3: Compute f= (c*9/5) +32.
Step 4: Print the result.
Step 5: Stop the process.
-----------------------------------------------------------------------------------------------------------------------
--- FLOWCHART - Celsius to Fahrenheit Converter ---
--- PROGRAM - Celsius to Fahrenheit Converter---
# include <stdio.h>
int main()
{
float c, f;
printf("Temparature in Celsius:");
scanf("n%f", &c);
f = (c * 9 / 5) + 32;
printf("nTemparature in Fahrenheit is %.1fF", f);
return 0;
}
-----------------------------------------------------------------------------------------------------------------------
Result:
Thus the C Program to convert the temperature from Celsius to Fahrenheit was executed and verified
successfully.
--- PROBLEM DESCRIPTION - quadratic equation roots ---
Quadratic Equation Roots
Write a program to find the roots of given quadratic equation. The
Quadratic equation is of the form ax2+bx+c = 0.
Input Format:
Input consists of 3 integer corresponding to a,b and c respectively.
Output Format:
Print the of the equation formed by the given values of a,b,c. Display the roots correct to 1 decimal place.
Refer sample input and output for formatting specifications.
[All text in bold corresponds to input and the rest corresponds to
output.]
Sample Input and Output:
Enter the values of a,b,c :
1
4
4
The roots are:
root1 = -2.0
root2 = -2.0
-----------------------------------------------------------------------------------------------------------------------
--- ALGORITHM - quadratic equation roots ---
Step 1: Start the process.
Step 2: Declare and get the values for a,b,c.
Step 3: Calculate root1=(-b+(b*b-4*a*c))/(2*a) and
root2=(-b-(b*b-4*a*c))/(2*a).
Step 4: Display the result.
Step 5: Stop the process.
-----------------------------------------------------------------------------------------------------------------------
--- FLOWCHART - quadratic equation roots ---
--- PROGRAM - quadratic equation roots---
# include <stdio.h>
# include <math.h>
int main()
{
int a, b, c;
float root1, root2;
printf("Enter the values of a,b,c :");
scanf("%d %d %d", &a, &b, &c);
root1 = (-b + sqrt((b * b) - (4 * a * c))) / (2 * a);
root2 = (-b - sqrt((b * b) - (4 * a * c))) / (2 * a);
printf("nThe roots are:");
printf("nroot1 = %.1f", root1);
printf("nroot2 = %.1f", root2);
return 0;
}
-----------------------------------------------------------------------------------------------------------------------
Result:
Thus the C Program to find the roots of the quadratic equation was executed and verified successfully.

More Related Content

Similar to Module 1 programs

Gsp 215 Future Our Mission/newtonhelp.com
Gsp 215 Future Our Mission/newtonhelp.comGsp 215 Future Our Mission/newtonhelp.com
Gsp 215 Future Our Mission/newtonhelp.comamaranthbeg8
 
GSP 215 Doing by learn/newtonhelp.com
GSP 215 Doing by learn/newtonhelp.comGSP 215 Doing by learn/newtonhelp.com
GSP 215 Doing by learn/newtonhelp.combellflower126
 
GSP 215 Become Exceptional/newtonhelp.com
GSP 215 Become Exceptional/newtonhelp.comGSP 215 Become Exceptional/newtonhelp.com
GSP 215 Become Exceptional/newtonhelp.combellflower148
 
GSP 215 Perfect Education/newtonhelp.com
GSP 215 Perfect Education/newtonhelp.comGSP 215 Perfect Education/newtonhelp.com
GSP 215 Perfect Education/newtonhelp.combellflower169
 
1 Faculty of Computer Studies Information Technology a.docx
1 Faculty of Computer Studies Information Technology a.docx1 Faculty of Computer Studies Information Technology a.docx
1 Faculty of Computer Studies Information Technology a.docxmercysuttle
 
GSP 215 RANK Become Exceptional--gsp215rank.com
GSP 215 RANK Become Exceptional--gsp215rank.comGSP 215 RANK Become Exceptional--gsp215rank.com
GSP 215 RANK Become Exceptional--gsp215rank.comclaric119
 
GSP 215 RANK Achievement Education--gsp215rank.com
GSP 215 RANK Achievement Education--gsp215rank.comGSP 215 RANK Achievement Education--gsp215rank.com
GSP 215 RANK Achievement Education--gsp215rank.comclaric169
 
C - Programming Assignment 1 and 2
C - Programming Assignment 1 and 2C - Programming Assignment 1 and 2
C - Programming Assignment 1 and 2Animesh Chaturvedi
 
Programming in C by SONU KUMAR.pptx
Programming in C by SONU KUMAR.pptxProgramming in C by SONU KUMAR.pptx
Programming in C by SONU KUMAR.pptxSONU KUMAR
 
Answers To Selected Exercises For Fortran 90 95 For Scientists And Engineers
Answers To Selected Exercises For Fortran 90 95 For Scientists And EngineersAnswers To Selected Exercises For Fortran 90 95 For Scientists And Engineers
Answers To Selected Exercises For Fortran 90 95 For Scientists And EngineersSheila Sinclair
 
Oop lab assignment 01
Oop lab assignment 01Oop lab assignment 01
Oop lab assignment 01Drjilesh
 
best notes in c language
best notes in c languagebest notes in c language
best notes in c languageIndia
 
Bba105 computer fundamentals..
Bba105  computer fundamentals..Bba105  computer fundamentals..
Bba105 computer fundamentals..smumbahelp
 
Devry cis-170-c-i lab-5-of-7-arrays-and-strings
Devry cis-170-c-i lab-5-of-7-arrays-and-stringsDevry cis-170-c-i lab-5-of-7-arrays-and-strings
Devry cis-170-c-i lab-5-of-7-arrays-and-stringsnoahjamessss
 
Devry cis-170-c-i lab-5-of-7-arrays-and-strings
Devry cis-170-c-i lab-5-of-7-arrays-and-stringsDevry cis-170-c-i lab-5-of-7-arrays-and-strings
Devry cis-170-c-i lab-5-of-7-arrays-and-stringscskvsmi44
 

Similar to Module 1 programs (20)

Java Practice Set
Java Practice SetJava Practice Set
Java Practice Set
 
Gsp 215 Future Our Mission/newtonhelp.com
Gsp 215 Future Our Mission/newtonhelp.comGsp 215 Future Our Mission/newtonhelp.com
Gsp 215 Future Our Mission/newtonhelp.com
 
GSP 215 Doing by learn/newtonhelp.com
GSP 215 Doing by learn/newtonhelp.comGSP 215 Doing by learn/newtonhelp.com
GSP 215 Doing by learn/newtonhelp.com
 
GSP 215 Become Exceptional/newtonhelp.com
GSP 215 Become Exceptional/newtonhelp.comGSP 215 Become Exceptional/newtonhelp.com
GSP 215 Become Exceptional/newtonhelp.com
 
GSP 215 Perfect Education/newtonhelp.com
GSP 215 Perfect Education/newtonhelp.comGSP 215 Perfect Education/newtonhelp.com
GSP 215 Perfect Education/newtonhelp.com
 
1 Faculty of Computer Studies Information Technology a.docx
1 Faculty of Computer Studies Information Technology a.docx1 Faculty of Computer Studies Information Technology a.docx
1 Faculty of Computer Studies Information Technology a.docx
 
GSP 215 RANK Become Exceptional--gsp215rank.com
GSP 215 RANK Become Exceptional--gsp215rank.comGSP 215 RANK Become Exceptional--gsp215rank.com
GSP 215 RANK Become Exceptional--gsp215rank.com
 
GSP 215 RANK Achievement Education--gsp215rank.com
GSP 215 RANK Achievement Education--gsp215rank.comGSP 215 RANK Achievement Education--gsp215rank.com
GSP 215 RANK Achievement Education--gsp215rank.com
 
Mmt 001
Mmt 001Mmt 001
Mmt 001
 
C - Programming Assignment 1 and 2
C - Programming Assignment 1 and 2C - Programming Assignment 1 and 2
C - Programming Assignment 1 and 2
 
C++ in 10 Hours.pdf.pdf
C++ in 10 Hours.pdf.pdfC++ in 10 Hours.pdf.pdf
C++ in 10 Hours.pdf.pdf
 
Programming in C by SONU KUMAR.pptx
Programming in C by SONU KUMAR.pptxProgramming in C by SONU KUMAR.pptx
Programming in C by SONU KUMAR.pptx
 
Answers To Selected Exercises For Fortran 90 95 For Scientists And Engineers
Answers To Selected Exercises For Fortran 90 95 For Scientists And EngineersAnswers To Selected Exercises For Fortran 90 95 For Scientists And Engineers
Answers To Selected Exercises For Fortran 90 95 For Scientists And Engineers
 
paython practical
paython practical paython practical
paython practical
 
LMmanual.pdf
LMmanual.pdfLMmanual.pdf
LMmanual.pdf
 
Oop lab assignment 01
Oop lab assignment 01Oop lab assignment 01
Oop lab assignment 01
 
best notes in c language
best notes in c languagebest notes in c language
best notes in c language
 
Bba105 computer fundamentals..
Bba105  computer fundamentals..Bba105  computer fundamentals..
Bba105 computer fundamentals..
 
Devry cis-170-c-i lab-5-of-7-arrays-and-strings
Devry cis-170-c-i lab-5-of-7-arrays-and-stringsDevry cis-170-c-i lab-5-of-7-arrays-and-strings
Devry cis-170-c-i lab-5-of-7-arrays-and-strings
 
Devry cis-170-c-i lab-5-of-7-arrays-and-strings
Devry cis-170-c-i lab-5-of-7-arrays-and-stringsDevry cis-170-c-i lab-5-of-7-arrays-and-strings
Devry cis-170-c-i lab-5-of-7-arrays-and-strings
 

Recently uploaded

hyundai capital 2023 consolidated financial statements
hyundai capital 2023 consolidated financial statementshyundai capital 2023 consolidated financial statements
hyundai capital 2023 consolidated financial statementsirhcs
 
00971508021841 حبوب الإجهاض في دبي | أبوظبي | الشارقة | السطوة |❇ ❈ ((![© ر
00971508021841 حبوب الإجهاض في دبي | أبوظبي | الشارقة | السطوة |❇ ❈ ((![©  ر00971508021841 حبوب الإجهاض في دبي | أبوظبي | الشارقة | السطوة |❇ ❈ ((![©  ر
00971508021841 حبوب الإجهاض في دبي | أبوظبي | الشارقة | السطوة |❇ ❈ ((![© رnafizanafzal
 
Toyota Kata Coaching for Agile Teams & Transformations
Toyota Kata Coaching for Agile Teams & TransformationsToyota Kata Coaching for Agile Teams & Transformations
Toyota Kata Coaching for Agile Teams & TransformationsStefan Wolpers
 
Most Visionary Leaders in Cloud Revolution, Shaping Tech’s Next Era - 2024 (2...
Most Visionary Leaders in Cloud Revolution, Shaping Tech’s Next Era - 2024 (2...Most Visionary Leaders in Cloud Revolution, Shaping Tech’s Next Era - 2024 (2...
Most Visionary Leaders in Cloud Revolution, Shaping Tech’s Next Era - 2024 (2...CIO Look Magazine
 
Thompson_Taylor_MBBS_PB1_2024-03 (1)- Project & Portfolio 2.pptx
Thompson_Taylor_MBBS_PB1_2024-03 (1)- Project & Portfolio 2.pptxThompson_Taylor_MBBS_PB1_2024-03 (1)- Project & Portfolio 2.pptx
Thompson_Taylor_MBBS_PB1_2024-03 (1)- Project & Portfolio 2.pptxtmthompson1
 
How Bookkeeping helps you in Cost Saving, Tax Saving and Smooth Business Runn...
How Bookkeeping helps you in Cost Saving, Tax Saving and Smooth Business Runn...How Bookkeeping helps you in Cost Saving, Tax Saving and Smooth Business Runn...
How Bookkeeping helps you in Cost Saving, Tax Saving and Smooth Business Runn...YourLegal Accounting
 
Innomantra Viewpoint - Building Moonshots : May-Jun 2024.pdf
Innomantra Viewpoint - Building Moonshots : May-Jun 2024.pdfInnomantra Viewpoint - Building Moonshots : May-Jun 2024.pdf
Innomantra Viewpoint - Building Moonshots : May-Jun 2024.pdfInnomantra
 
Should Law Firms Outsource their Bookkeeping
Should Law Firms Outsource their BookkeepingShould Law Firms Outsource their Bookkeeping
Should Law Firms Outsource their BookkeepingYourLegal Accounting
 
Shots fired Budget Presentation.pdf12312
Shots fired Budget Presentation.pdf12312Shots fired Budget Presentation.pdf12312
Shots fired Budget Presentation.pdf12312LR1709MUSIC
 
Jual Obat Aborsi Di Sibolga wa 0851/7541/5434 Cytotec Misoprostol 200mcg Pfizer
Jual Obat Aborsi Di Sibolga wa 0851/7541/5434 Cytotec Misoprostol 200mcg PfizerJual Obat Aborsi Di Sibolga wa 0851/7541/5434 Cytotec Misoprostol 200mcg Pfizer
Jual Obat Aborsi Di Sibolga wa 0851/7541/5434 Cytotec Misoprostol 200mcg PfizerPusat Herbal Resmi BPOM
 
MichaelStarkes_UncutGemsProjectSummary.pdf
MichaelStarkes_UncutGemsProjectSummary.pdfMichaelStarkes_UncutGemsProjectSummary.pdf
MichaelStarkes_UncutGemsProjectSummary.pdfmstarkes24
 
First Time Home Buyer's Guide - KM Realty Group LLC
First Time Home Buyer's Guide - KM Realty Group LLCFirst Time Home Buyer's Guide - KM Realty Group LLC
First Time Home Buyer's Guide - KM Realty Group LLCTammy Jackson
 
如何办理(SUT毕业证书)斯威本科技大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(SUT毕业证书)斯威本科技大学毕业证成绩单本科硕士学位证留信学历认证如何办理(SUT毕业证书)斯威本科技大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(SUT毕业证书)斯威本科技大学毕业证成绩单本科硕士学位证留信学历认证ogawka
 
obat aborsi jakarta wa 081336238223 jual obat aborsi cytotec asli di jakarta9...
obat aborsi jakarta wa 081336238223 jual obat aborsi cytotec asli di jakarta9...obat aborsi jakarta wa 081336238223 jual obat aborsi cytotec asli di jakarta9...
obat aborsi jakarta wa 081336238223 jual obat aborsi cytotec asli di jakarta9...yulianti213969
 
10 Easiest Ways To Buy Verified TransferWise Accounts
10 Easiest Ways To Buy Verified TransferWise Accounts10 Easiest Ways To Buy Verified TransferWise Accounts
10 Easiest Ways To Buy Verified TransferWise Accountshttps://localsmmshop.com/
 
Powerpoint showing results from tik tok metrics
Powerpoint showing results from tik tok metricsPowerpoint showing results from tik tok metrics
Powerpoint showing results from tik tok metricsCaitlinCummins3
 
wagamamaLab presentation @MIT 20240509 IRODORI
wagamamaLab presentation @MIT 20240509 IRODORIwagamamaLab presentation @MIT 20240509 IRODORI
wagamamaLab presentation @MIT 20240509 IRODORIIRODORI inc.
 
Unlocking Growth The Power of Outsourcing for CPA Firms
Unlocking Growth The Power of Outsourcing for CPA FirmsUnlocking Growth The Power of Outsourcing for CPA Firms
Unlocking Growth The Power of Outsourcing for CPA FirmsYourLegal Accounting
 

Recently uploaded (20)

WAM Corporate Presentation May 2024_w.pdf
WAM Corporate Presentation May 2024_w.pdfWAM Corporate Presentation May 2024_w.pdf
WAM Corporate Presentation May 2024_w.pdf
 
hyundai capital 2023 consolidated financial statements
hyundai capital 2023 consolidated financial statementshyundai capital 2023 consolidated financial statements
hyundai capital 2023 consolidated financial statements
 
00971508021841 حبوب الإجهاض في دبي | أبوظبي | الشارقة | السطوة |❇ ❈ ((![© ر
00971508021841 حبوب الإجهاض في دبي | أبوظبي | الشارقة | السطوة |❇ ❈ ((![©  ر00971508021841 حبوب الإجهاض في دبي | أبوظبي | الشارقة | السطوة |❇ ❈ ((![©  ر
00971508021841 حبوب الإجهاض في دبي | أبوظبي | الشارقة | السطوة |❇ ❈ ((![© ر
 
Toyota Kata Coaching for Agile Teams & Transformations
Toyota Kata Coaching for Agile Teams & TransformationsToyota Kata Coaching for Agile Teams & Transformations
Toyota Kata Coaching for Agile Teams & Transformations
 
Most Visionary Leaders in Cloud Revolution, Shaping Tech’s Next Era - 2024 (2...
Most Visionary Leaders in Cloud Revolution, Shaping Tech’s Next Era - 2024 (2...Most Visionary Leaders in Cloud Revolution, Shaping Tech’s Next Era - 2024 (2...
Most Visionary Leaders in Cloud Revolution, Shaping Tech’s Next Era - 2024 (2...
 
Thompson_Taylor_MBBS_PB1_2024-03 (1)- Project & Portfolio 2.pptx
Thompson_Taylor_MBBS_PB1_2024-03 (1)- Project & Portfolio 2.pptxThompson_Taylor_MBBS_PB1_2024-03 (1)- Project & Portfolio 2.pptx
Thompson_Taylor_MBBS_PB1_2024-03 (1)- Project & Portfolio 2.pptx
 
Obat Aborsi Surabaya 0851\7696\3835 Jual Obat Cytotec Di Surabaya
Obat Aborsi Surabaya 0851\7696\3835 Jual Obat Cytotec Di SurabayaObat Aborsi Surabaya 0851\7696\3835 Jual Obat Cytotec Di Surabaya
Obat Aborsi Surabaya 0851\7696\3835 Jual Obat Cytotec Di Surabaya
 
How Bookkeeping helps you in Cost Saving, Tax Saving and Smooth Business Runn...
How Bookkeeping helps you in Cost Saving, Tax Saving and Smooth Business Runn...How Bookkeeping helps you in Cost Saving, Tax Saving and Smooth Business Runn...
How Bookkeeping helps you in Cost Saving, Tax Saving and Smooth Business Runn...
 
Innomantra Viewpoint - Building Moonshots : May-Jun 2024.pdf
Innomantra Viewpoint - Building Moonshots : May-Jun 2024.pdfInnomantra Viewpoint - Building Moonshots : May-Jun 2024.pdf
Innomantra Viewpoint - Building Moonshots : May-Jun 2024.pdf
 
Should Law Firms Outsource their Bookkeeping
Should Law Firms Outsource their BookkeepingShould Law Firms Outsource their Bookkeeping
Should Law Firms Outsource their Bookkeeping
 
Shots fired Budget Presentation.pdf12312
Shots fired Budget Presentation.pdf12312Shots fired Budget Presentation.pdf12312
Shots fired Budget Presentation.pdf12312
 
Jual Obat Aborsi Di Sibolga wa 0851/7541/5434 Cytotec Misoprostol 200mcg Pfizer
Jual Obat Aborsi Di Sibolga wa 0851/7541/5434 Cytotec Misoprostol 200mcg PfizerJual Obat Aborsi Di Sibolga wa 0851/7541/5434 Cytotec Misoprostol 200mcg Pfizer
Jual Obat Aborsi Di Sibolga wa 0851/7541/5434 Cytotec Misoprostol 200mcg Pfizer
 
MichaelStarkes_UncutGemsProjectSummary.pdf
MichaelStarkes_UncutGemsProjectSummary.pdfMichaelStarkes_UncutGemsProjectSummary.pdf
MichaelStarkes_UncutGemsProjectSummary.pdf
 
First Time Home Buyer's Guide - KM Realty Group LLC
First Time Home Buyer's Guide - KM Realty Group LLCFirst Time Home Buyer's Guide - KM Realty Group LLC
First Time Home Buyer's Guide - KM Realty Group LLC
 
如何办理(SUT毕业证书)斯威本科技大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(SUT毕业证书)斯威本科技大学毕业证成绩单本科硕士学位证留信学历认证如何办理(SUT毕业证书)斯威本科技大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(SUT毕业证书)斯威本科技大学毕业证成绩单本科硕士学位证留信学历认证
 
obat aborsi jakarta wa 081336238223 jual obat aborsi cytotec asli di jakarta9...
obat aborsi jakarta wa 081336238223 jual obat aborsi cytotec asli di jakarta9...obat aborsi jakarta wa 081336238223 jual obat aborsi cytotec asli di jakarta9...
obat aborsi jakarta wa 081336238223 jual obat aborsi cytotec asli di jakarta9...
 
10 Easiest Ways To Buy Verified TransferWise Accounts
10 Easiest Ways To Buy Verified TransferWise Accounts10 Easiest Ways To Buy Verified TransferWise Accounts
10 Easiest Ways To Buy Verified TransferWise Accounts
 
Powerpoint showing results from tik tok metrics
Powerpoint showing results from tik tok metricsPowerpoint showing results from tik tok metrics
Powerpoint showing results from tik tok metrics
 
wagamamaLab presentation @MIT 20240509 IRODORI
wagamamaLab presentation @MIT 20240509 IRODORIwagamamaLab presentation @MIT 20240509 IRODORI
wagamamaLab presentation @MIT 20240509 IRODORI
 
Unlocking Growth The Power of Outsourcing for CPA Firms
Unlocking Growth The Power of Outsourcing for CPA FirmsUnlocking Growth The Power of Outsourcing for CPA Firms
Unlocking Growth The Power of Outsourcing for CPA Firms
 

Module 1 programs

  • 1. --- PROBLEM DESCRIPTION - M2P1 - 4 - Splitting into Teams --- Splitting into Teams During the Physical Education hour, PT sir has decided to conduct some team games. He wants to split the students in the class into equal sized teams. In some cases, there may be some students who are left out from teams and he wanted to use the left out students to assist him in conducting the team games. For instance, if there are 50 students in the class and if the class has to be divided into 7 equal sized teams, 7 students will be there in each team and 1 student will be left out. PT sir asks your help to automate this team splitting task. Can you please help him out? Input Format: Input consists of 2 integers. The first integer corresponds to the number of students in the class and the second integer corresponds to the number of teams. Output Format: Refer sample input and output for formatting specifications. Sample Input and Output: [All text in bold corresponds to input and the rest corresponds to output] Number of students: 60 Number of teams: 8 The number of students in each team is 7 and left out is 4 -----------------------------------------------------------------------------------------------------------------------
  • 2. --- ALGORITHM - M2P1 - 4 - Splitting into Teams --- Step 1: Start the program. Step 2: Read the number of students [a] and number of teams [b] as from the user. Step 3: Use a/b to calculate the number of students in each team and a % b to calculate the left out students. Step 4: Display the result to the user Step 5: Stop the program -----------------------------------------------------------------------------------------------------------------------
  • 3. --- FLOWCHART - M2P1 - 4 - Splitting into Teams ---
  • 4. --- PROGRAM - M2P1 - 4 - Splitting into Teams--- # include <stdio.h> int main() { int n, t; printf(" Number of students :n"); scanf("%d", &n); printf("Number of teams:n"); scanf("%d", &t); int m, l; m = n / t; l = n % t; printf("The number of students in each team is %d and left out is %d", m, l); return 0; } ----------------------------------------------------------------------------------------------------------------------- Result: Thus the C Program for splitting the number of students into team was executed and verified successfully.
  • 5. --- PROBLEM DESCRIPTION - Odd or Even using Bitwise and Operator --- Odd or Even using Bitwise and Operator Write a C program to find whether the given number is odd or even, using Bitwise ' & ' Operator. Input Format: The input consists of an integer. Output Format: Output should display whether the input is Odd or Even. Refersample input and output for formatting specifications. [All text in bold corresponds to input and the rest corresponds to output] Sample Input and Output 1: Enter the number : 5 Odd Sample Input and Output 2: Enter the number : 8 Even -----------------------------------------------------------------------------------------------------------------------
  • 6. --- ALGORITHM - Odd or even using Bitwise and Operator --- Step 1: Start the process. Step 2: Declare and get the values for a,b,c. Step 3: Use n & 1 to check whether the given number is odd or even Step 4: Display the result to the user Step 5: Stop the program -----------------------------------------------------------------------------------------------------------------------
  • 7. --- FLOWCHART - Odd or even using Bitwise and Operator ---
  • 8. --- PROGRAM - Odd or even using Bitwise and Operator--- # include <stdio.h> int main() { int a; printf("Enter the number :n"); scanf("%d", &a); (a & 1) ? printf("Odd n") : printf("Even n"); return 0; } ----------------------------------------------------------------------------------------------------------------------- Result: Thus the C Program for finding whether the given number is odd or even using bitwise operator was executed and verified successfully.
  • 9. --- PROBLEM DESCRIPTION - Largest of three numbers using Ternary Operator --- Largest of three numbers using Ternary Operator Write a program to find greatest of three numbers, using Ternary Operator. Input Format: The input consists of 3 integers. Output Format: Output should display the greatest of the 3 numbers. Refersample input and output for formatting specifications. [All text in bold corresponds to input and the rest corresponds to output] Sample Input and Output 1: Enter the numbers: 5 8 2 8 is the greatest number Sample Input and Output 2: Enter the numbers: 44 16 23 44 is the greatest number -----------------------------------------------------------------------------------------------------------------------
  • 10. --- ALGORITHM - Largest of three numbers using Ternary Operator --- Step 1: Start the process. Step 2: Initialize variables a,b,c and d. Get the values of a,b,c from user. Step 3: Using ternary operator find the greatest among 3 numbers and store the value in big. Step 4: Display the value of big. Step 5: Stop the process. -----------------------------------------------------------------------------------------------------------------------
  • 11. --- FLOWCHART - Largest of three numbers using Ternary Operator ---
  • 12. --- PROGRAM - Largest of three numbers using Ternary Operator--- # include <stdio.h> int main() { int a, b, c; printf("Enter the numbers:n"); scanf("%d %d %d", &a, &b, &c); int big; big = (a > b) ? ((a > c) ? a : c) : ((b > c) ? b : c); printf("%d is the greatest number", big); return 0; } ----------------------------------------------------------------------------------------------------------------------- Result: Thus the C Program for finding largest of three numbers using ternary operator was executed and verified successfully.
  • 13. --- PROBLEM DESCRIPTION - M2P2 - 7 - THREE IDIOTS --- THREE IDIOTS Ajay, Binoy and Chandru were very close friends at school. They were very good in Mathematics and they were the pet students of Emily Mam. Their gang was known as 3-idiots. Ajay, Binoy and Chandru live in the same locality. A new student Dinesh joins their class and he wanted to be friends with them. He asked Binoy about his house address. Binoy wanted to test Dinesh's mathematical skills. Binoy told Dinesh that his house is at the midpoint of the line joining Ajay's house and Chandru's house. Dinesh was puzzled. Can you help Dinesh out? Given the coordinates of the 2 end points of a line (x1,y1) and (x2,y2), write a program to find the midpoint of the line. Input Format: Input consists of 4 integers. The first integer corresponds to x1 . The second integer corresponds to y1. The third and fouth integers correspond to x2 and y2 respectively. Output Format: Refer Sample Input and Output for exact formatting specifications. [All floating point values are displayed correct to 1 decimal place] Sample Input and Output: [All text in bold corresponds to input and the rest corresponds to output] X1 2 Y1 4 X2 10 Y2 15 Binoy's house is located at (6.0,9.5) -----------------------------------------------------------------------------------------------------------------------
  • 14. --- ALGORITHM - M2P2 - 7 - THREE IDIOTS --- Step 1:Start the process. Step 2:Declare and get the values for x1,y1,x2,y2. Step 3:Declare and calculate x3=(x1+x2)/2 and y3=(y1+y2)/2. Step 4:Display the result. Step 5:Stop the process. -----------------------------------------------------------------------------------------------------------------------
  • 15. --- FLOWCHART - M2P2 - 7 - THREE IDIOTS ---
  • 16. --- PROGRAM - M2P2 - 7 - THREE IDIOTS--- #include<stdio.h> int main() { int x1, x2, y1, y2; char c1 = '('; char c2 = ')'; printf("X1n"); scanf("%d", &x1); printf("Y1n"); scanf("%d", &y1); printf("X2n"); scanf("%d", &x2); printf("Y2n"); scanf("%d", &y2); float x3 = ((x1 + x2) / 2.0); float y3 = ((y1 + y2) / 2.0); printf("Binoy's house is located at %c%.1f,%.1f%c", c1, x3, y3, c2); return 0; } ----------------------------------------------------------------------------------------------------------------------- Result: Thus the C Program for finding distance between two points was executed and verified successfully.
  • 17. --- PROBLEM DESCRIPTION - Celsius to Fahrenheit Converter --- Celsius to Fahrenheit Converter The relatioship between Celsius (C) and Fahrenheit (F) degrees for measuring temperature is linear. Find an equation relating C and F if 0 C corresponds to 32 F and 100 C corresponds to 212 F. Write a program to simulate Celsius to Fahrenheit Converter. Input Format: Input consists of a single integer which corresponds to a measure of temparature in Celcius. Output Format: Refer Sample Input and Output for exact formatting specifications. [All floating point values are displayed correct to 1 decimal place] Sample Input and Output: [All text in bold corresponds to input and the rest corresponds to output] Temparature in Celsius: 12 Temparature in Fahrenheit is 53.6F -----------------------------------------------------------------------------------------------------------------------
  • 18. --- ALGORITHM - Celsius to Fahrenheit Converter --- Step 1: Start the process. Step 2: Initialize c and f. Step 3: Get the value of c from the user. Step 3: Compute f= (c*9/5) +32. Step 4: Print the result. Step 5: Stop the process. -----------------------------------------------------------------------------------------------------------------------
  • 19. --- FLOWCHART - Celsius to Fahrenheit Converter ---
  • 20. --- PROGRAM - Celsius to Fahrenheit Converter--- # include <stdio.h> int main() { float c, f; printf("Temparature in Celsius:"); scanf("n%f", &c); f = (c * 9 / 5) + 32; printf("nTemparature in Fahrenheit is %.1fF", f); return 0; } ----------------------------------------------------------------------------------------------------------------------- Result: Thus the C Program to convert the temperature from Celsius to Fahrenheit was executed and verified successfully.
  • 21. --- PROBLEM DESCRIPTION - quadratic equation roots --- Quadratic Equation Roots Write a program to find the roots of given quadratic equation. The Quadratic equation is of the form ax2+bx+c = 0. Input Format: Input consists of 3 integer corresponding to a,b and c respectively. Output Format: Print the of the equation formed by the given values of a,b,c. Display the roots correct to 1 decimal place. Refer sample input and output for formatting specifications. [All text in bold corresponds to input and the rest corresponds to output.] Sample Input and Output: Enter the values of a,b,c : 1 4 4 The roots are: root1 = -2.0 root2 = -2.0 -----------------------------------------------------------------------------------------------------------------------
  • 22. --- ALGORITHM - quadratic equation roots --- Step 1: Start the process. Step 2: Declare and get the values for a,b,c. Step 3: Calculate root1=(-b+(b*b-4*a*c))/(2*a) and root2=(-b-(b*b-4*a*c))/(2*a). Step 4: Display the result. Step 5: Stop the process. -----------------------------------------------------------------------------------------------------------------------
  • 23. --- FLOWCHART - quadratic equation roots ---
  • 24. --- PROGRAM - quadratic equation roots--- # include <stdio.h> # include <math.h> int main() { int a, b, c; float root1, root2; printf("Enter the values of a,b,c :"); scanf("%d %d %d", &a, &b, &c); root1 = (-b + sqrt((b * b) - (4 * a * c))) / (2 * a); root2 = (-b - sqrt((b * b) - (4 * a * c))) / (2 * a); printf("nThe roots are:"); printf("nroot1 = %.1f", root1); printf("nroot2 = %.1f", root2); return 0; } ----------------------------------------------------------------------------------------------------------------------- Result: Thus the C Program to find the roots of the quadratic equation was executed and verified successfully.