C Programmi Essay

624 words - 3 pages

ngNicholas, 07-015

Turbo C++ Algorithms & Coding 1. Finding the absolute value of an integer Algorithm (single alternative control flow) Absolute Value ( ) Coding #include void main () { { 1. input n; int n; 2. if (n43) 5. print : Second Class; 6. else if (mark > 32) 7. print : Third Class; 8.else 9. print: Fail; } 3. Determining the roots of quadric equation Algorithm
Quadric Equation ( ) { 1. input a, b, c ; 2. d= b*b- 4*c*a ; 3. if (d 59) printf("first class"); else if (mark>44) printf("Second class"); else if (mark>32) printf("third class"); else printf("fail"); } Coding
#include #include void main() { float a,b,c,x1,x2,d; scanf ("%f%f%f",& a,& b,& c); d=(b*b-4*c*a); if (d79) 3. print : A+; 4. else if (n >74) 5. print : A; 6. else if (n > 69) 7. print : A-; 8. else if (n >64) 9. print: ...view middle of the document...

Finding whether a number is even or odd: Algorithm (double alternative control flow) Even Odd ( ) Coding #include void main () { { 1. input n; int n; 2. if (n MOD 2=0) scanf("%d", & n); 3. print : n is even; if (n %2==0) 4. else printf("even number"); 5. print : n is odd; else } printf("odd number"); } 6. Finding the area of a Circle by inputting the radius Algorithm (sequential control flow) Circle Area ( ) { 1. input r; 2. a= 3.14 * r * r ; 3. print : the area is = a ; } Coding #include void main () { float r, a; printf("enter radius"); scanf ("%f", & r); a= 3.14* r* r; printf("the area is=%f", a); }

Nicholas, 07-015

7. Finding the area of a Triangle by inputting base and height Algorithm (sequential control flow) Circle Triangle ( ) { 1. input b, h; 2. a= (0.5)* b * h ; 3. print : the area is = a ; } Coding #include void main () { float b, h, a; printf("enter base"); scanf ("%f", & b); printf("enter height"); scanf ("%f", & h); a= (0.5)*b*h; printf("the area is=%f", a); }

8. Finding the Interest of a sum of money Algorithm (sequential control flow) Simple Interest ( ) { 1. input p, r, y; 2. i= p* r* y; 3. print : the interest is = i ; } Coding #include void main () { float r,i; int p, y; printf("enter principal amount"); scanf ("%d", & p); printf("enter rate of interest"); scanf ("%f", & r); printf("enter year"); scanf ("%d", & y); i= p*r*y; printf("the interest is=%f", i); }

9. Finding whether a number is positive or negative Algorithm (Double alternative control flow) Positive Negative( ) { 1. input n; 2. if (n< 0) 3. print : the number is negative ; 4. else 5. print : the number is positive; } Coding #include void main () { float n; printf("enter the number"); scanf ("%f", & n); if (n< 0) printf("the number is negative"); else printf("the number is positive"); }

Other Essays Like C Programmi

The French And Indian War: The "Real" First World War

1955 words - 8 pages The Seven Years War, or more commonly referred to as “The French and Indian War”, has been called the true First World War. In this book The French and Indian War: Deciding the Fate of North America, the author and historian Walter R. Borneman paints a detailed and elaborate picture that justifies the claim of it being the first true war of global proportions. If ever there truly was a climax to the never ending feud of the European powers

Is The Use Of Animals In Medical Research A Necessary Measure?

1513 words - 7 pages Throughout history, animals have been used in experiments to test product safety and obtain medical knowledge that benefits both humans and animals alike. Every year there are numerous medical breakthroughs, such as medications and surgical instruments, which are tested on animals to insure their safety before they are deemed acceptable for human use. Even though the results of the experiments saved millions of human lives, they are also

Education And The Evolving Job Market

2363 words - 10 pages Anderson, K. (2007). “Differentiating Instruction to Include All Students.” Preventing School Failure. 51(3), 49-54. Burggraff, K. (2004). “Best Practices in Education: Differentiated Instruction.” DayOne Publishing. Dewey, J. (1929). “My Pedagogic Creed”. In Flinders, D. and Thornton, S. The Curriculum Studies Reader (pg. 34 – 44). New York, NY: Taylor & Francis. Gregory, G. and Chapman, C. (2007). Differentiated Instructional

Young And Relentless

1737 words - 7 pages There are numerous influences that can be responsible of teenager’s behaviors and attitude as they develop. One factor that is important to these behaviors is parental figures being over involved or uninvolved in their children’s lives. Many of these effects include illegal substance abuse, rising sexual activity, underage alcohol consumption, and tobacco use. Studies show parental participation plays a key role in the characteristics developed

The Natural Law Theory

1231 words - 5 pages Obeying by the natural law theory is the only true and moral way to live life; especially a life lived in God’s image. God’s presence is a guiding factor to obtaining a moral and virtuous life, which can only be obtained by following the natural law theory. God created a set of laws as a supreme guide for humans to live life, like any law these laws were created to ensure wellbeing for everyone. The laws he created are the civil law, the natural

Resolved: Presidential Signing Statements Threaten To Undermine The Rule Of Law And The Separation Of Powers

1811 words - 8 pages balance of power, there would be a higher level of understanding among all branches of government as well as more transparency (Bradley & Posner, 2006). References American Bar Association. (2006). Recommendation. Retrieved from website: www.americanbar.org/content/dam/aba/../20060823144113.pdf Bradley, C. A., & Posner, E. A. (2006). Presidential signing statements and executive power. Constitutional Commentary, 23(307), 307-364 Cass, R

Oppressive Systems Of Government In Egypt And Animal Farm

1529 words - 7 pages As in Egypt, Orwell demonstrates through his allegorical novel “Animal Farm” that leaders are able to establish and maintain power over a people, and in turn create an oppressive and corrupt government system. Orwell shows the significant difference in the education and levels of knowledge in the animals, and how the government takes advantage of this difference. The split between the levels of intelligence is portrayed in the first chapter when

The Pathway To Psychosis

1415 words - 6 pages psychosis. Works Cited Lardinois , M., Lataster , T., Mengelers, R., van Os , J., & Myin-Germeys, I. (2011). Childhood trauma and increased stress. ACTA PSYCHIATRICA, 28–35. Qoldman, M. B., & Mitchell, C. P. (2004). What Is the Functional Significance of Hippocampal Pathology in Schizophrenia? Schizophrenia Bulletin , 367-392. Rossler, W., Angst, J., Gamma, A., Haker, H., Stulz, N., Merikangas, K. R., & Ajdacic-Gross, V. (2011). Reappraisal of

Rated “M” For “More Censorship Not Needed”

1241 words - 5 pages Since the moment video games became a commercial success there have been people who have pushed for unfair amounts of censorship to be placed upon the content of the games and its availability to children. These groups push for increased regulations on content but there is already an appointed group to handle this issue, the ESRB. Even though there has been an increase in mature content in the video game industry, increased censorship is not

Four Components Of A Legally Astute Social Media Marketing Manager

1914 words - 8 pages , and try to come to an agreement. The type of dispute resolution that would work best with consumers, and businesses that use social medial would be negotiation. This way each party could represent themselves, both parties can mutually agree with the decision. This way the two parties can agree to a contract that will require the courts to resolve any future disputes (Bagley C. E., 2013).   How can the Federal Government Control Social Media

Obama's Values

1217 words - 5 pages As individuals, we don’t tend to take action unless it’s for self-interest; however, in Dreams from My Father, Obama spends three years, after college, as a community organizer in Chicago. Obama goes through tribulations, disappointments, and even complete failures organizing meaningful events, decisive meetings, and humble gatherings but he keeps working toward achieving any possible change in the community. Even though results give him every

Related Papers

The Separation Of Capital Ownership And Control

1577 words - 7 pages Wealth of Nations, 1776, Modern Library, Cannon Ed., New York. Jensen, M. C., and Meckling, W. H., (1976) Theory of the Firm: Managerial Behavior, Agency Costs and Ownership Structure. Journal of Financial Economics 3: 305-360. Fama E. F., (1980), Agency Problems and the Theory of the Firm, The Journal of Political Economy, The University of Chicago Press. Macey J. R. (2008), CORPORATE GOVERNANCE AS PROMISE, Corporate Governance, Princeton University Press.

The Versatility And Flexibility Of Oled's

1014 words - 5 pages In April 1, 2002, organic light emitting diodes gain rise in the scientific community with their published, more practical form at Ames Laboratory. “Scientists at the U.S. Department of Energy's Ames Laboratory, in collaboration with scientists at the University of Michigan, Ann Arbor, have developed and demonstrated a novel, fluorescence-based chemical sensor that is more compact, versatile and less expensive than existing technology of its

Comparing The Moral Virtues Of Antony And Julian The Apostate

1103 words - 5 pages Roman emperor Julian the Apostate and Christian leader Antony both exhibited many qualities of character during their existence. Both of them led very distinctive lives although shared several ethical values. Book 25 of “The Later Roman Empire” and the book “Early Christian Lives” show concrete evidence of this. In the following essay, I will argue how both leaders’ lives were devoted to their religious beliefs and their mutual cardinal virtues

Living In A Cashless Society Essay

1637 words - 7 pages Money in a traditional sense no longer exists. Money is becoming much of a concept than a physical material, and most ordinary bitter have not see the reality of the switch. People today are using credit and debit cards on a regular basis and in everyday situations such as meal purchased at fast food, highway tolls, clothing, groceries, gas stations, etc. all of these means of systems could be regarded as a cashless society or world. The question