תכנית שניה: חישוב שטח ריבוע #include void main() { int edge; int area; printf("Enter edge length\n"); scanf ("%d",&edge); area=edge*edge; printf("Square.

Slides:



Advertisements
Similar presentations
#include void main() { float x = 1.66, y = 1.75; printf(%f%f,ceil(x), floor(y)); }
Advertisements

Continuation of chapter 6…. Nested while loop A while loop used within another while loop is called nested while loop. Q. An illustration to generate.
Discrete Maths Objective to describe the Big-Oh notation for estimating the running time of programs , Semester 2, Running Time of.
Singly Linked List BTECH, EE KAZIRANGA UNIVERSITY.
For(int i = 1; i
Recursion Prog #include <stdio.h> #include<conio.h> main()
BNF <digit> ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
DS:Lab-1 Prepared by: Shipra Shukla Assistant Professor Kaziranga University.
void count_down (int count) { for(i=count; i>1; i--) printf(" %d\t", count); } printf("A%d\n", count); if(count>1) count_down(count-1); printf("B%d\n",
Making Choices in C if/else statement logical operators break and continue statements switch statement the conditional operator.
Quadrature. 二阶 : 中点公式 : 梯形公式 : 四阶公式 : Simpson’s 1/3 rd Rule.
Array_strcpy void array_strcpy(char dest[], char src[]) { int i = 0; while (src[i] != '\0') { dest[i] = src[i]; i++; } dest[i] = '\0'; }
Sort the given string, without using string handling functions.
Tinaliah, S. Kom.. * * * * * * * * * * * * * * * * * #include using namespace std; void main () { for (int i = 1; i
Introduction to C# Erick Pranata © Sekolah Tinggi Teknik Surabaya 1.
Triana Elizabeth, S.Kom. #include using namespace std; void main () { for (int i = 1; i
Dr. Faiyaz Gadiwalla Hinduja College. Q 2 A) a) Wages calc. b) Sort c) Output Q3 A) a) Series b) Display result c) Output.
By Senem Kumova Metin 1 POINTERS + ARRAYS + STRINGS REVIEW.
Solution April 13, #include int main( void ) { int salaries[ 11 ] = { 0 }; /*total salary */ int sales; /* sales per karyawan */ double salary;
Growing Arrays in C By: Victoria Tielebein CS 265- Spring 2011.
Multidimensional Arrays. Example Write a program to keep track of all warmup scores for all students. Need a list of a list of scores Student – score.
CS1061 C Programming Lecture 5: Building Blocks of Simple Programs A. O’Riordan, 2004.
Declarations/Data Types/Statements. Assignments Due – Homework 1 Reading – Chapter 2 – Lab 1 – due Monday.
Introduction to Computers and Programming Class 6 Introduction to C Professor Avi Rosenfeld.
Last time on Clang משתנה: "פתק" המשמש את המחשב לשמירת מידע. לכל משתנה יש שם וטיפוס כללים לשמות משתנים –חייבים להכיל רק אותיות, מספרים ו '_' –חייבים להתחיל.
Pointers Example Use int main() { int *x; int y; int z; y = 10; x = &y; y = 11; *x = 12; z = 15; x = &z; *x = 5; z = 8; printf(“%d %d %d\n”, *x, y, z);
Chapter 4: Basic C Operators
LAB 2: C BASICS ITS100: Computer and Programming Lab. Section 1 Instructor: Wirat Chinnan TAs: Ms. Sasirassamee Buavirat Mr. Thanasan Tanhermhong (Tum)
C Functions Programmer-defined functions – Functions written by the programmer to define specific tasks. Functions are invoked by a function call. The.
IF-ELSE IF-ELSE STATEMENT SWITCH-CASE STATEMENT Computer Programming Asst. Prof. Dr. Choopan Rattanapoka and Asst. Prof. Dr. Suphot Chunwiphat.
CHAPTER 5: Decision Making and Looping CSEB113 PRINCIPLES of PROGRAMMING by Badariah Solemon 1BS (Sept 2013)
1 ICS103 Programming in C Lecture 7: Introduction to Functions.
LAB 3: FORMATTED I/O AND C LIBRARY FUNCTIONS ITS100: Computer and Programming Lab. Section 1 Instructor: Wirat Chinnan TAs: Ms. Sasirassamee Buavirat Mr.
Program to calculate product of odd numbers b/w 1 and 15 #include main() { int prod = 1, x; for(x = 1; x
Selection-making Decisions Selection allows you to choose between two or more possible program flow --- it lets you make decisions in your program. Examples.
Struct 1. Definition: Using struct to define a storage containing different types. For example it can contain int, char, float and array at the same time.
Definition of function Types of Function Built-in User Defined Catagories of Function No argument No return value Argument but No return value No argument.
Principles of Programming Chapter 4: Basic C Operators  In this chapter, you will learn about:  Arithmetic operators  Unary operators  Binary operators.
Week 4 Program Control Structure
CSCI 171 Presentation 3. Operators Instructs C to perform some operation Assignment = Mathematical Relational Logical.
CSEB 114: PRINCIPLE OF PROGRAMMING Chapter 4: Basic C Operators.
Print Row Function void PrintRow(float x[ ][4],int i) { int j; for(j=0;j
Int fact (int n) { If (n == 0) return 1; else return n * fact (n – 1); } 5 void main () { Int Sum; : Sum = fact (5); : } Factorial Program Using Recursion.
Engineering Problem#1 Engr201 Computer Programming for Engineers Faculty of Engineering Chiang Mai University 1.
Algorithm & Flow Charts Decision Making and Looping
Second Grade Word List Second Grade Sight Words. 224.
Principles of Programming - NI July Chapter 4: Basic C Operators In this chapter, you will learn about: Assignment operators Arithmetic operators.
Week 4 – Chapter 3 Repetition.
Condition Statements.
Functions in C Mrs. Chitra M. Gaikwad.
Introduction to C Programming
Compiled and ready to run Memory Stack /*
Introduction to Programming and the C Language
Computer Programming Summer 2017
Introduction to C Programming
The while Looping Structure
Elided to examples only
Decision making If statement.
Recursive GCD Demo public class Euclid {
class PrintOnetoTen { public static void main(String args[]) {
Computer Programming Techniques Semester 1, 1998
CPS125 Week 5.
Week 3 – Program Control Structure
EECE.2160 ECE Application Programming
Character Arrays char string1[] = “first”;
Main() { int fact; fact = Factorial(4); } main fact.
switch/case statement - General form
More Loops Topics Counter-Controlled (Definite) Repetition
Range check 範圍檢查: int age; int score; int month; 1-12
Presentation transcript:

תכנית שניה: חישוב שטח ריבוע #include void main() { int edge; int area; printf("Enter edge length\n"); scanf ("%d",&edge); area=edge*edge; printf("Square area:%d\n",area); }

#include void main() { int grade; printf("Enter grade\n"); scanf ("%d",&grade); if (grade<56){ printf("failed\n"); } else{ if ((grade>=56) && (grade<=79)){ printf("passed\n"); } else{ printf("good grade\n"); } } }

#include void main() { int grade; printf("Enter grade\n"); scanf ("%d",&grade); if (grade<56) printf("failed\n"); else if (grade>=56 && grade<=79) printf("passed\n"); else printf("good grade\n"); }