1. The document discusses different loop constructs in C programming including for, while, and do-while loops.
2. It provides examples of using each loop type to iterate through a set number of iterations and print output.
3. The key differences between each loop type are explained such as when the condition is checked and where loop initialization and update occur.
Computer Science Investigatory Project class 12thiamtheanupam
This document is a project report submitted by Anupam Anand for their computer science class. It details a project on developing software for a police station. The report includes sections on the purpose, coding, structures used, functions, and a guide Mr. P.K. Gupta who oversaw the project. It describes building a program to store, modify, display and delete criminal records from a police station database.
This document presents the steps to solve a system of 3 equations with 3 unknowns (x, y, z) using Gaussian elimination. It starts with the original system of equations in matrix form. It then applies row operations such as multiplication, addition, and division of rows to put the matrix in reduced row echelon form. The final form reveals the solutions for x, y, and z. These solutions are verified by substituting them back into the original system of equations.
- Recurrences describe functions in terms of their values on smaller inputs and arise when algorithms contain recursive calls to themselves.
- To analyze the running time of recursive algorithms, the recurrence must be solved to find an explicit formula or bound the expression in terms of n.
- Examples of recurrences and their solutions are given, including binary search (O(log n)), dividing the input in half at each step (O(n)), and dividing the input in half but examining all items (O(n)).
- Methods for solving recurrences include iteration, substitution, and using recursion trees to "guess" the solution.
This document configures IP addresses, firewall NAT, routing, and firewall mangle rules on a router with 3 interfaces: ether1, ether3, ether4. It sets IP addresses for the interfaces, enables masquerading for ether3 and ether4. Traffic incoming on ether1 is classified and marked to be routed out either ether3 or ether4 interfaces based on destination address. Routing tables are configured to send traffic with specific marks out the corresponding interfaces.
This document discusses trigonometric identities. It includes:
- Pythagorean identities relating sine, cosine, and their reciprocals
- Tangent/cotangent identities relating tangent and cotangent to sine and cosine
- Fundamental trig identities for sine, tangent, cotangent, and secant
- Examples of simplifying trig expressions using identities and of proving trig identities by manipulating expressions until they are equal.
The document discusses increasing and decreasing functions and average rate of change, providing examples of finding the average rate of change between two points on a function by taking the slope of the secant line and sketches of graphs verifying solutions. It also provides homework problems asking to find the average rate of change for a given function between intervals.
The minimax algorithm is used to determine the best possible move for a player in two-player zero-sum games like chess. It works by having each player assume their opponent will make the best counter-move. The algorithm searches the game tree by alternately maximizing and minimizing at each level to assign a value to leaf nodes, then backing up values towards the root. This process determines the move with the highest minimum value from the player's perspective.
International Journal of Engineering and Science Invention (IJESI) is an international journal intended for professionals and researchers in all fields of computer science and electronics. IJESI publishes research articles and reviews within the whole field Engineering Science and Technology, new teaching methods, assessment, validation and the impact of new technologies and it will continue to provide information on the latest trends and developments in this ever-expanding subject. The publications of papers are selected through double peer reviewed to ensure originality, relevance, and readability. The articles published in our journal can be accessed online.
Computer Science Investigatory Project class 12thiamtheanupam
This document is a project report submitted by Anupam Anand for their computer science class. It details a project on developing software for a police station. The report includes sections on the purpose, coding, structures used, functions, and a guide Mr. P.K. Gupta who oversaw the project. It describes building a program to store, modify, display and delete criminal records from a police station database.
This document presents the steps to solve a system of 3 equations with 3 unknowns (x, y, z) using Gaussian elimination. It starts with the original system of equations in matrix form. It then applies row operations such as multiplication, addition, and division of rows to put the matrix in reduced row echelon form. The final form reveals the solutions for x, y, and z. These solutions are verified by substituting them back into the original system of equations.
- Recurrences describe functions in terms of their values on smaller inputs and arise when algorithms contain recursive calls to themselves.
- To analyze the running time of recursive algorithms, the recurrence must be solved to find an explicit formula or bound the expression in terms of n.
- Examples of recurrences and their solutions are given, including binary search (O(log n)), dividing the input in half at each step (O(n)), and dividing the input in half but examining all items (O(n)).
- Methods for solving recurrences include iteration, substitution, and using recursion trees to "guess" the solution.
This document configures IP addresses, firewall NAT, routing, and firewall mangle rules on a router with 3 interfaces: ether1, ether3, ether4. It sets IP addresses for the interfaces, enables masquerading for ether3 and ether4. Traffic incoming on ether1 is classified and marked to be routed out either ether3 or ether4 interfaces based on destination address. Routing tables are configured to send traffic with specific marks out the corresponding interfaces.
This document discusses trigonometric identities. It includes:
- Pythagorean identities relating sine, cosine, and their reciprocals
- Tangent/cotangent identities relating tangent and cotangent to sine and cosine
- Fundamental trig identities for sine, tangent, cotangent, and secant
- Examples of simplifying trig expressions using identities and of proving trig identities by manipulating expressions until they are equal.
The document discusses increasing and decreasing functions and average rate of change, providing examples of finding the average rate of change between two points on a function by taking the slope of the secant line and sketches of graphs verifying solutions. It also provides homework problems asking to find the average rate of change for a given function between intervals.
The minimax algorithm is used to determine the best possible move for a player in two-player zero-sum games like chess. It works by having each player assume their opponent will make the best counter-move. The algorithm searches the game tree by alternately maximizing and minimizing at each level to assign a value to leaf nodes, then backing up values towards the root. This process determines the move with the highest minimum value from the player's perspective.
International Journal of Engineering and Science Invention (IJESI) is an international journal intended for professionals and researchers in all fields of computer science and electronics. IJESI publishes research articles and reviews within the whole field Engineering Science and Technology, new teaching methods, assessment, validation and the impact of new technologies and it will continue to provide information on the latest trends and developments in this ever-expanding subject. The publications of papers are selected through double peer reviewed to ensure originality, relevance, and readability. The articles published in our journal can be accessed online.
Gibraltar Asset Management provides various investment services including execution-only dealing, advisory services, and discretionary portfolio management. For discretionary clients, GAM constructs model portfolios consisting of equities, fixed income, commodities, and special situations. Equity holdings are selected based on criteria like low debt, earnings visibility, dividends, and value. Fixed income, commodities, and special situations further diversify portfolios. Clients receive regular reporting and their assets are held securely with a third-party custodian.
Block parties, break dancing and cultural backgroundmusic_hayes
Block parties in the Bronx in the 1970s featured DJs playing dance music on powerful sound systems for dancers. Breakdancing emerged in the late 1960s and 1970s from dancers in Harlem battling each other with acrobatic dance moves. Hip hop in the early 1980s was influenced by rap music using sampled beats and scratching, though it initially had little commercial success. Acts like Run-D.M.C. and the Beastie Boys helped bring rap into the mainstream, while gangsta rap later promoted criminal lifestyles and objectified women.
Gibraltar Asset Management provides various investment services including execution-only trading, advisory services, and discretionary portfolio management. For discretionary clients, GAM constructs model portfolios allocated across equities, fixed income, commodities, and other assets based on the client's risk profile and objectives. Equity holdings are selected from defensive, cyclical, and thematic categories. Special situations and options/CFDs may also be utilized depending on a client's risk tolerance. Assets are held with an external custodian for security. Regular reporting includes statements, corporate action notifications, and periodic valuations. Fees are based on a transparent pricing structure.
Gibraltar Asset Management provides various investment services including execution-only trading, advisory services, and discretionary portfolio management. For discretionary clients, GAM's investment committee constructs model portfolios allocated across equities, special situations, commodities, and fixed income based on the client's risk profile and objectives. Equity holdings are selected from core defensive, cyclical, and thematic categories. Special situations aim to take advantage of short-term market anomalies. Commodities including gold and silver provide diversification benefits.
This document provides an overview of Gibraltar Asset Management Limited (GAM), including its history, regulation, memberships, independence, organization, security of client assets, client reporting, and services. GAM offers execution-only, advisory, and discretionary investment management services. For discretionary clients, GAM constructs model portfolios using equities, special situations, commodities, and fixed interest securities. Equities are selected based on factors like low debt, earnings visibility, dividends, value, and simplicity. Special situations seeks short-term anomalies, and commodities provide diversification benefits.
Digital technologies have significantly shaped the production and consumption of popular music over time. Early digital audio devices developed in the late 1970s allowed for convenient manipulation, storage, and transmission of audio. Sony's Walkman, introduced in 1979, was a revolutionary portable audio player and helped popularize personal audio devices. Further technological developments included the introduction of the compact disc in 1982, Digital Audio Tape in 1987, and MiniDisc in 1992. Each new format aimed to improve upon previous technologies but some, like DAT, saw only moderate commercial success. Digital audio players utilizing formats like MP3 achieved widespread popularity with the iPod's launch in 2001.
The document discusses different loop constructs in C programming including for, while, and do-while loops. It provides examples of using each loop type, explaining the basic syntax and flow. Key aspects like initialization, condition checking, and increment/decrement are described for the different loops.
This document contains information about arrays and pointers in C programming. It includes code examples demonstrating how to declare and initialize arrays, access array elements using indexes and pointers, pass arrays to functions, and perform operations on arrays such as summing elements. Multidimensional arrays and pointer arithmetic are also discussed. The examples output the results of operations on sample data arrays.
This document contains examples of C++ code demonstrating various programming concepts including:
- Declaring and initializing variables
- Arithmetic, assignment, and compound assignment operators
- goto loops
- Functions with parameters and returning values
- Passing parameters by reference
- Multiple return values from functions
- Default values in functions
The document describes several programs to solve problems related to quadratic equations, reversing integers, finding square roots, and determining if a year is a leap year. It includes algorithms and C code to:
1) Take coefficients of a quadratic equation as input and compute all possible roots, handling real, equal, and complex cases.
2) Reverse an integer number and check if it is a palindrome.
3) Find the square root of a number without using library functions.
4) Read a year and determine if it is a leap year, considering end of century rules.
The document discusses Halstead's software science measures for analyzing programs. It defines key metrics like program vocabulary, length, volume, difficulty level, and effort required. These metrics are calculated based on the number of unique operators and operands in a program. Formulas are provided to estimate values of length, volume, level and effort based on operator and operand counts. An example C program is analyzed to demonstrate calculating these metrics.
The document discusses C++ programming concepts including:
1) How to write a basic C++ program using Visual C++ including compiling and executing code.
2) Common C++ constructs such as variables, data types, constants, operators, and basic input/output statements.
3) Examples of programs to calculate simple math problems and demonstrate if/else conditional statements.
The document discusses different looping statements like while, do-while, for and provides examples to calculate factorial values and print tables using these loops. It also explains nested loops and provides programs to print various number series patterns using loops. The document contains sample programs and outputs for different looping concepts along with MCQ questions.
The document contains pseudocode and code examples for various algorithms:
1. An if-then-else statement that checks if x is less than 10 and prints or assigns x depending on if it is less than 5.
2. Pseudocode for calculating the average of a set of values by summing them and counting them, discarding values after "end of data".
3. Code to find the real and imaginary roots of a quadratic equation by calculating the discriminant and using appropriate formulas based on its sign.
The document discusses a blog that provides free solutions manuals and solved exercises for many university textbooks. It states that the solutions manuals contain clear explanations of all the exercises from the textbooks. It invites the reader to visit the blog to download the solutions manuals for free.
The document discusses various control structures in C including loops. It covers while, do-while, and for loops. It provides examples of using each loop type to calculate a grade point average (GPA) using both counter-controlled and sentinel-controlled repetition. Key differences between while, do-while and for loops are explained along with flowcharts demonstrating the logic flow for each. Common errors to avoid with loops in C are also listed.
This C++ program generates random number quiz questions by randomly selecting two numbers and an operator (+, -, or *). It calculates the result, tracks the number of correct answers, and displays the user's final score. The program allows the user to choose the number of questions and difficulty level. Higher difficulty levels use larger number ranges to generate more challenging questions. Time is incorporated into the random number generation to vary the questions each attempt.
PROGRAMMING IN C EXAMPLE PROGRAMS FOR NEW LEARNERS - SARASWATHI RAMALINGAMSaraswathiRamalingam
Fundamental Algorithms, Exchanging the values of Two Variables,Counting,Summation of a Set of Numbers,Factorial Computation ,Sine Function Computation ,Generation of the Fibonacci Sequence,Reversing the Digits of an Integer,Base Conversion , Character to Number Conversion , Factoring Methods: Finding the square Root of a Number ,The Smallest Divisor of an Integer,The Greatest Common Divisor of the two integers,Generating Prime Numbers,Computing the Prime Factors of an integer ,Generation of Pseudo,random Numbers,Raising a Number to a Large Power,Computing the nth Fibonacci Number,thiruvalluvar university syllabus,unit 5,computer science basics,new syllabus,programming in c,example program in c,
The document introduces asynchronous programming and coroutines. It discusses:
1. The evolution of input/output loops from blocking to asynchronous models using callbacks and futures. Examples include Twisted, Tornado, Tkinter.
2. How futures/promises allow adding callbacks to be notified of results asynchronously, avoiding blocking. Examples shown in JavaScript, Twisted, asyncio.
3. Key aspects of coroutines like yielding and awaiting futures to resume execution asynchronously. Rules for writing asyncio coroutines in Python are provided.
4. Asynchronous programming allows concurrent execution without blocking, improving responsiveness through asynchronous callbacks and coroutines.
C program to find factorial of number using recursion as well as iteration ,
Calculate power of a number program in c using Recursion and Iteration, Write a C program to count digits of a number using Recursion and Iteration, Write a C program to find sum of first n natural numbers using Recursion, C program to print sum of digits of a given number using recursion ,Write a C program to find nth term in Fibonacci Series using Recursion, C program to find out the GCD (Greatest Common Divisor )of the two numbers using recursion,
Write a C program to find the first upper case letter in the given string using recursion, write C program to calculate length of the string using Recursion ,
Write a program in C to count number of divisors of a given number using recursion, Recursive program to check whether a given number is prime or composite,
C program to displays integers 100 through 1 using Recursion and Iteration, Write a program in C to convert a decimal number to binary using recursion,
Recursion Stack of factorial of 3 Recursion stack of 4th term of Fibonacci
Gibraltar Asset Management provides various investment services including execution-only dealing, advisory services, and discretionary portfolio management. For discretionary clients, GAM constructs model portfolios consisting of equities, fixed income, commodities, and special situations. Equity holdings are selected based on criteria like low debt, earnings visibility, dividends, and value. Fixed income, commodities, and special situations further diversify portfolios. Clients receive regular reporting and their assets are held securely with a third-party custodian.
Block parties, break dancing and cultural backgroundmusic_hayes
Block parties in the Bronx in the 1970s featured DJs playing dance music on powerful sound systems for dancers. Breakdancing emerged in the late 1960s and 1970s from dancers in Harlem battling each other with acrobatic dance moves. Hip hop in the early 1980s was influenced by rap music using sampled beats and scratching, though it initially had little commercial success. Acts like Run-D.M.C. and the Beastie Boys helped bring rap into the mainstream, while gangsta rap later promoted criminal lifestyles and objectified women.
Gibraltar Asset Management provides various investment services including execution-only trading, advisory services, and discretionary portfolio management. For discretionary clients, GAM constructs model portfolios allocated across equities, fixed income, commodities, and other assets based on the client's risk profile and objectives. Equity holdings are selected from defensive, cyclical, and thematic categories. Special situations and options/CFDs may also be utilized depending on a client's risk tolerance. Assets are held with an external custodian for security. Regular reporting includes statements, corporate action notifications, and periodic valuations. Fees are based on a transparent pricing structure.
Gibraltar Asset Management provides various investment services including execution-only trading, advisory services, and discretionary portfolio management. For discretionary clients, GAM's investment committee constructs model portfolios allocated across equities, special situations, commodities, and fixed income based on the client's risk profile and objectives. Equity holdings are selected from core defensive, cyclical, and thematic categories. Special situations aim to take advantage of short-term market anomalies. Commodities including gold and silver provide diversification benefits.
This document provides an overview of Gibraltar Asset Management Limited (GAM), including its history, regulation, memberships, independence, organization, security of client assets, client reporting, and services. GAM offers execution-only, advisory, and discretionary investment management services. For discretionary clients, GAM constructs model portfolios using equities, special situations, commodities, and fixed interest securities. Equities are selected based on factors like low debt, earnings visibility, dividends, value, and simplicity. Special situations seeks short-term anomalies, and commodities provide diversification benefits.
Digital technologies have significantly shaped the production and consumption of popular music over time. Early digital audio devices developed in the late 1970s allowed for convenient manipulation, storage, and transmission of audio. Sony's Walkman, introduced in 1979, was a revolutionary portable audio player and helped popularize personal audio devices. Further technological developments included the introduction of the compact disc in 1982, Digital Audio Tape in 1987, and MiniDisc in 1992. Each new format aimed to improve upon previous technologies but some, like DAT, saw only moderate commercial success. Digital audio players utilizing formats like MP3 achieved widespread popularity with the iPod's launch in 2001.
The document discusses different loop constructs in C programming including for, while, and do-while loops. It provides examples of using each loop type, explaining the basic syntax and flow. Key aspects like initialization, condition checking, and increment/decrement are described for the different loops.
This document contains information about arrays and pointers in C programming. It includes code examples demonstrating how to declare and initialize arrays, access array elements using indexes and pointers, pass arrays to functions, and perform operations on arrays such as summing elements. Multidimensional arrays and pointer arithmetic are also discussed. The examples output the results of operations on sample data arrays.
This document contains examples of C++ code demonstrating various programming concepts including:
- Declaring and initializing variables
- Arithmetic, assignment, and compound assignment operators
- goto loops
- Functions with parameters and returning values
- Passing parameters by reference
- Multiple return values from functions
- Default values in functions
The document describes several programs to solve problems related to quadratic equations, reversing integers, finding square roots, and determining if a year is a leap year. It includes algorithms and C code to:
1) Take coefficients of a quadratic equation as input and compute all possible roots, handling real, equal, and complex cases.
2) Reverse an integer number and check if it is a palindrome.
3) Find the square root of a number without using library functions.
4) Read a year and determine if it is a leap year, considering end of century rules.
The document discusses Halstead's software science measures for analyzing programs. It defines key metrics like program vocabulary, length, volume, difficulty level, and effort required. These metrics are calculated based on the number of unique operators and operands in a program. Formulas are provided to estimate values of length, volume, level and effort based on operator and operand counts. An example C program is analyzed to demonstrate calculating these metrics.
The document discusses C++ programming concepts including:
1) How to write a basic C++ program using Visual C++ including compiling and executing code.
2) Common C++ constructs such as variables, data types, constants, operators, and basic input/output statements.
3) Examples of programs to calculate simple math problems and demonstrate if/else conditional statements.
The document discusses different looping statements like while, do-while, for and provides examples to calculate factorial values and print tables using these loops. It also explains nested loops and provides programs to print various number series patterns using loops. The document contains sample programs and outputs for different looping concepts along with MCQ questions.
The document contains pseudocode and code examples for various algorithms:
1. An if-then-else statement that checks if x is less than 10 and prints or assigns x depending on if it is less than 5.
2. Pseudocode for calculating the average of a set of values by summing them and counting them, discarding values after "end of data".
3. Code to find the real and imaginary roots of a quadratic equation by calculating the discriminant and using appropriate formulas based on its sign.
The document discusses a blog that provides free solutions manuals and solved exercises for many university textbooks. It states that the solutions manuals contain clear explanations of all the exercises from the textbooks. It invites the reader to visit the blog to download the solutions manuals for free.
The document discusses various control structures in C including loops. It covers while, do-while, and for loops. It provides examples of using each loop type to calculate a grade point average (GPA) using both counter-controlled and sentinel-controlled repetition. Key differences between while, do-while and for loops are explained along with flowcharts demonstrating the logic flow for each. Common errors to avoid with loops in C are also listed.
This C++ program generates random number quiz questions by randomly selecting two numbers and an operator (+, -, or *). It calculates the result, tracks the number of correct answers, and displays the user's final score. The program allows the user to choose the number of questions and difficulty level. Higher difficulty levels use larger number ranges to generate more challenging questions. Time is incorporated into the random number generation to vary the questions each attempt.
PROGRAMMING IN C EXAMPLE PROGRAMS FOR NEW LEARNERS - SARASWATHI RAMALINGAMSaraswathiRamalingam
Fundamental Algorithms, Exchanging the values of Two Variables,Counting,Summation of a Set of Numbers,Factorial Computation ,Sine Function Computation ,Generation of the Fibonacci Sequence,Reversing the Digits of an Integer,Base Conversion , Character to Number Conversion , Factoring Methods: Finding the square Root of a Number ,The Smallest Divisor of an Integer,The Greatest Common Divisor of the two integers,Generating Prime Numbers,Computing the Prime Factors of an integer ,Generation of Pseudo,random Numbers,Raising a Number to a Large Power,Computing the nth Fibonacci Number,thiruvalluvar university syllabus,unit 5,computer science basics,new syllabus,programming in c,example program in c,
The document introduces asynchronous programming and coroutines. It discusses:
1. The evolution of input/output loops from blocking to asynchronous models using callbacks and futures. Examples include Twisted, Tornado, Tkinter.
2. How futures/promises allow adding callbacks to be notified of results asynchronously, avoiding blocking. Examples shown in JavaScript, Twisted, asyncio.
3. Key aspects of coroutines like yielding and awaiting futures to resume execution asynchronously. Rules for writing asyncio coroutines in Python are provided.
4. Asynchronous programming allows concurrent execution without blocking, improving responsiveness through asynchronous callbacks and coroutines.
C program to find factorial of number using recursion as well as iteration ,
Calculate power of a number program in c using Recursion and Iteration, Write a C program to count digits of a number using Recursion and Iteration, Write a C program to find sum of first n natural numbers using Recursion, C program to print sum of digits of a given number using recursion ,Write a C program to find nth term in Fibonacci Series using Recursion, C program to find out the GCD (Greatest Common Divisor )of the two numbers using recursion,
Write a C program to find the first upper case letter in the given string using recursion, write C program to calculate length of the string using Recursion ,
Write a program in C to count number of divisors of a given number using recursion, Recursive program to check whether a given number is prime or composite,
C program to displays integers 100 through 1 using Recursion and Iteration, Write a program in C to convert a decimal number to binary using recursion,
Recursion Stack of factorial of 3 Recursion stack of 4th term of Fibonacci
The document introduces different types of loops in C programming including while, for, and do-while loops. It explains that loops allow repeated execution of a block of code until a certain condition is met. The key types of loops are pretest and post-test loops, which differ in when the loop condition is evaluated. It provides examples of implementing various loops in C and using concepts like initialization, updating, nesting, and break/continue statements.
The document contains code snippets for several simple C programs that demonstrate basic programming concepts like input/output, variables, conditional statements, loops, functions etc. The programs include examples of swapping values, arithmetic operations using switch case, printing multiplication tables, finding currency denominations in a given amount, addition/multiplication tables and more. Each code snippet is preceded by a brief description and followed by sample input/output to illustrate program behavior.
An efficient algorithm for the computation of Bernoulli numbersXequeMateShannon
This document describes an efficient algorithm for computing large Bernoulli numbers. The algorithm is based on the asymptotic formula for Bernoulli numbers and uses the Euler product formula with primes. The algorithm allows individual Bernoulli numbers to be computed much faster than recurrence formulas. Using this algorithm, the authors computed B(750,000) in a few hours and set a record by computing B(5,000,000), which has over 27 million decimal digits. The algorithm involves computing the principal term, a few terms of the Euler product, and the fractional part using the Von Staudt-Clausen formula.
All I Needed for Functional Programming I Learned in High School AlgebraEric Normand
Are you tired of forgetting which keys go in which maps? Are your data transformation pipelines reaching trans-continental proportions? A smidgen of high school algebra may go a long way to eliminating your deeply nested headaches. In this talk, we will explore several functional programming concepts and techniques, lifted right out of high school algebra, that can deepen your functional programming skills and get you slicing your problems along new dimensions.
Similar to การเขียนคำสั่งควบคุมแบบวนซ้ำ กลุ่ม 4 ม.6 ห้อง2 (20)
32. n
key loop =>……………
Report Score
****************************
No. => ……………
name is => …………..
midterm is => …………..
Final is => ……………
* Score = ……………
*****************************
*Average Score is = ………….
*****************************
35. 1.6 action)
1 (num)
2) for (n =1; n<=num ;
n++)
2.1-2.6
3
2.1) (n)
2.2) (name)
(midterm)
(final)
2.3) (score) =
midterm + final
2.4) score
2.5) (sum) = sum +
score
2.6) 2
3) (average) = sum / num
36. start
2.
num
For (n = 1 ; n <= num ; n++) n > num
n <= num
n Averge = sum / num
name,midterm,final average
Score = midterm + final end
score
sum = sum + score
37. 3.
#include <stdio.h>
/* file name ex_for3.cpp*/
main ()
{
char name [30] ;
int midterm = 0 , final = 0 , score = 0 ,n , num ;
float sum = 0 , average = 0 ;
printf (“ key loop => “) ; scanf (“%d “,&num) ;
Printf (“n Report Score n”) ;
printf(“*************************n n”) ;
for(n = 1;n <= num ; n++)
{
printf ({“No. => %d n” , n) ;
printf (“Name is => “) ; scanf (“%s”,name) ;
printf (“midterm is => “) ; scanf (“%d”&midterm) ;
printf (“final is => “) ; scanf (“%d”&final) ;
score = midterm =+ final;
printf ( “* score = %dn”,score) ;
sum = sum + score ;
printf (“*****************n”) ;
}
average = sum / num ;
printf (“* Averge score is = %.2f n” , averge) ;
printf (“***********************n) ;
}
48. #include <stdio.h>
int counter ,num ;
char word[20] = "Bodindecha";
main()
{
Num = 0;
counter = 3;
do /*
start do while */
{
printf("ntcounter = %2d my school is %s print
round %d. ",counter,word,++num);
counter = counter + 2 ;
} while (counter < 11 ); /*
end do while */
getch();
}
/* end main() */
49. counter
do while
printf("ntcounter = %2d my school is %s print round %d.
",counter,word,++num); counter = counter + 2;
counter < 11
counter