240 likes | 267 Views
Algorithm is a work plan depicting task sections like joining a community, studying hard, robotics projects, graduating, finding a high-paying job, and enjoying life. Learn how to make an Algorithm using flowcharts and pseudocodes. Introduction to C Programming covers standard libraries, IO functions, data types, variable declarations, and operators, essential in programming. Enhance your programming skills with flowcharts, pseudocodes, and C programming basics.
E N D
What is Algorithm ? Algorithm, is a work plan that shows the sections of a duty.
Example • Join Hacettepe Robotics Community. • Study hard. • Join Robot Projects. • Graduate from Hacettepe. • Find a Job with high salary. • Enjoy ! ☻
How to make an Algorithm ? • Flowcharts • Pseudocodes
Yes Start Tap Temperature No Temp. <25 ? Print ‘hot’. Print ‘Cold’. End
Types of Flowcharts • Sequence • Selection • Loop
Start Start Start Sequence Selection Loop Decision Process Process Process Process Process Decision Process End End End
Pseudocodes • Have a usage like routine speaking. • No syntax. • Aims to understand how program works.
Example • 1 if • 2 students grade > 60 • 3 print ‘PASSED’ • 4 else • 5 print ‘FAILED’
Introduction to C Programming • Standart libraries • Standart input/output functions • Data types • Variable declarations • Operators
Standart Libraries • Stdio.h ( Standart input/output) : • Defines variable types • Various functions for performing input / output • Stdlib.h ( Standart Library) : • Various functions for performing general functions
Standart Libraries • Define Library; • #include<stdio.h> • #include<stdlib.h>
Standart Input / Output Functions • Printf • Scanf
Printf 1)Single Text; • printf("Hello World !");
Printf 2)Control Characters;
Printf 3)Conversion Specifier(Place Holder);
#include <stdio.h> int main() { printf("Welcome to Hacettepe Robotics Community!\n"); }
Scanf • scanf("%Conversion_specifier",&Variable _name);
#include <stdio.h> int main() { int x,y,sum; printf("Insert x and y>> !\n"); scanf("%d%d",&x,&y); sum=x+y; printf("Sum is >> %d",sum); }
For a single character Data Type For a string Conversion Specifier