Programming in C Part 2.

Slides:



Advertisements
Similar presentations
Complete Structure class Date {class Date { private :private : // private data and functions// private data and functions public :public : // public data.
Advertisements

For(int i = 1; i
Algorithm & Flow Charts Decision Making and Looping Presented By Manesh T Course:1090 CS.
AB 11 22 33 44 55 66 77 88 99 10  20  19  18  17  16  15  14  13  12  11  21  22  23  24  25  26  27  28.
Algorithm: Step by step procedure of solving a particular problem. Pseudo code: Artificial informal language used to develop algorithms. Flow chart: Graphical.
Unit 2 The if-else-if LECTURE – 14
Join to C language Session 2 By Reza Gholamzadeh st Semester.
Understanding Loops Using C Language Week 15 Mr.Omer Salih.
D EVELOPING P ROGRAMS USING ALGORITHMS AND FLOW CHARTS AND VICE VERSA Week 14 Mr.Mohammed Rahmath.
1 CSE1301 Computer Programming Lecture 28 Recursion (Part 2)
Guidelines for working with Microsoft Visual Studio.Net.
PS2-Slides Function Call Diagram. PS2-Slides int Factorial(int n) { if(n == 0){ return 1; } else { return n*Factorial(n-1); } int main(void) x{ printf("%d!
1 CSE1301 Computer Programming Lecture 27 Recursion (Part 1)
Guidelines for working with Microsoft Visual Studio 6.
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);
If () else statement, switch statement, while () loop, do…while() loop and for( ; ; ) loop 1.
Programs Day 1 and 2. Write a Program to: 1: Read in two numbers and output the largest 2: Read in an exam mark and output the appropriate grade according.
Recursive Function Computer Programming. Recursive Function Recursive function is a function that calls itself There is nothing special about calling.
UNIT III. Functions  To divide a big program into a number of relatively smaller and easily manageable subprograms. Each subprogram in C is called a.
1 What We Will Learn  Introduction  Passing input parameters  Producing output  Scope of variables  Storage Class of variables  Function usage example.
WEEK 4 Class Activities Lecturer’s slides.
CP104 Introduction to Programming Selection structures_2 Lecture 10 __ 1 If statement (preview version) Syntax form: if ( condition) Statements else Statements.
FUNCTIONS A function is a set of instructions that can perform a specific task accordingly. A function is a program that performs a specific task according.
Rray Programs. Insert and element in the given position of the Array rray.
LAB 2: REPETITION STRUCTURE #2 ITS100: Computer and Programming Lab. Section 1 Instructor: Wirat Chinnan TAs: Ms. Sasirassamee Buavirat Mr. Thanasan Tanhermhong.
Asstt. Prof Mandeep Kaur Computer Dept. TOPIC: Control Statements in C language.
Print Row Function void PrintRow(float x[ ][4],int i) { int j; for(j=0;j
8. ARRAYS. Aggregate variables Scalar variables –Single value Aggregate variables –Collection of values –Arrays: elements have the same type.
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.
Array Sort. Sort Pass 1 Sort Pass 2 Sort Pass 3.
Linked List. Insert a node at the beginning #include struct node { int data; struct node* next; }; struct node* head; void Insert(int x) { node *temp.
Algorithm & Flow Charts Decision Making and Looping
CSC COMPUTER EDUCATION, M.K.B.NAGAR CHAPTER 3. CSC COMPUTER EDUCATION, M.K.B.NAGAR Session Objectives Explain If, If..else statements Understand Looping.
More on Functions. Assignment 1 Let’s talk … -We always validate to ensure that our program accepts only valid input. - This is done as early in the program.
Arrays Name, Index, Address. Arrays – Declaration and Initialization int x; y[0] y[1] y[2]
Recursive. Recursive F(n) = F(n-1) + F(n-2) n! = (n-1)! x n C(m,n) = C(m-1,n-1)+C(m-1,n)......
The Repetition control structure using while loop.
Exercise 2 : Using for loop Repetition (loop) (1)control variable initialization (2)Test Conditon (3)Modification of control variable value order : (1)
Control Structures Introduction
WHILE, DO-WHILE AND FOR LOOPS
Greatest Common Divisor
Greatest Common Divisor
CHP-2 ARRAYS.
Unit VI- Selection – Making Decisions, Repetition
LESSON 3 IO, Variables and Operators
MULTI-DIMENSIONAL ARRAY
Linked list.
Array 9/8/2018.
Functions Dr. Sajib Datta
CHAPTER 7 RECURSIVE FUNCTION
Engineering Programming A
Chapter 5 POINTERs.
Lec 5.
Pointers and dynamic memory
CSCE 206 Lab Structured Programming in C
CSCE 206 Lab Structured Programming in C
Objective #1 To be able to factor equations by finding the Greatest Common Factor (GCF)
Who Wants To Be A Millionaire?
Recursion Prog #include <stdio.h> #include<conio.h> main()
Name _______________________Period ___ Date ______
Control Statements_2.
Reading: ‘Washington, DC’
Week 6 CPS125.
CSCE 206 Lab Structured Programming in C
Thing / Person:____________________ Dates:_________________
CSCE 206 Lab Structured Programming in C
C Programming Mr. KAJAL MAJI ASSISTANT PROFESSOR DEPARTMENT OF PHYSICS
컴퓨터 프로그래밍 기초 - 13th : 마지막 수업 -
Control Structure គោលបំណងនៃមេរៀន អ្វីជា Control structure ?
Visit for more Learning Resources
Presentation transcript:

Programming in C Part 2

printf("enter value of a,b &c:"); scanf("%d%d%d",&a,&b,&c); Program to print the greatest of three numbers #include<stdio.h> #include<conio.h> int main(void) { int a,b,c; printf("enter value of a,b &c:"); scanf("%d%d%d",&a,&b,&c); if((a>b)&&(a>c)) printf("%d is greatest",a); if((b>a)&&(b>c)) printf("%d is greatest",b); if((c>b)&&(c>a)) printf("%d is greatest",c); }

printf("enter any year:"); scanf("%d",&n); if(n%4==0) Program to find if a year is a leap year or not int n; printf("enter any year:"); scanf("%d",&n); if(n%4==0) printf("year is leap year"); else printf("year is not leap year");

Question Write a program to print your name, Reg_number, and date of birth.