SlideShare a Scribd company logo
1 of 9
Robot by
Gulnaz
 // CGassignment2.cpp : Making a simple Robot;
 //Gulnaz Akhter;
 #include "stdafx.h"
 // Run by Visual C++ 6 with OpenGL
 #include <math.h>
 #include <glut.h>
 void init (void)
 {
 /* select clearing (background) color */
 glClearColor (0.0, 0.0, 0.0, 1.0);
 // (red, green, blue, alpha), used by glClear
 /* initialize viewing values */
 glMatrixMode(GL_PROJECTION);
 glLoadIdentity();
 glOrtho(1.0, -1.0, -1.0, 1.0, -1.0, -1.0);
 // (left, right, bottom, top, near, far)
 }
 void display(void)
 {


 glColor3f (1.0, 0.0, 0.0);
 glBegin(GL_POLYGON);
 //Head;
 glVertex2f (0.08, 0.11);
 glVertex2f (0.01, 0.11);
 glVertex2f (0.01, 0.20);
 glVertex2f (0.08, 0.20);
 glEnd();
 glTranslatef(-0.01,0.07,0.00);
 glTranslatef(0.07,-0.20,0.00);
 glColor3f (1.0, 0.0, 0.0);
 glBegin(GL_POLYGON);
 //Body;
 glVertex2f (-0.05, -0.05);
 glVertex2f (0.02, -0.05);
 glVertex2f (0.02, 0.18);
 glVertex2f (-0.05, 0.18);
 glEnd();
 glTranslatef(-0.04,0.2,0.00);
 glColor3f (1.0, 0.0, 0.0);
 glBegin(GL_POLYGON);
 //Neck;
 glVertex2f (0.03, 0.06);
 glVertex2f (0.02, 0.06);
 glVertex2f (0.02, -0.02);
 glVertex2f (0.03, -0.02);
 glEnd();
 glTranslatef(0.02,-0.56,0.00);
 glColor3f (1.0, 0.0, 0.0);
 glBegin(GL_POLYGON);
 //Right Leg;
 glVertex2f (0.04, 0.10);
 glVertex2f (0.02, 0.10);
 glVertex2f (0.02, 0.30);
 glVertex2f (0.04, 0.30);
 glEnd();
 glTranslatef(-0.06,-0.01,0.00);
 glColor3f (1.0, 0.0, 0.0);
 glBegin(GL_POLYGON);
 //Left Leg;
 glVertex2f (0.05, 0.11);
 glVertex2f (0.03, 0.11);
 glVertex2f (0.03, 0.31);
 glVertex2f (0.05, 0.31);
 glEnd();
 //Mouth
 glTranslatef(0.05,0.63,0.00);
 glColor3f (0.0, 1.0, 0.0);
 glBegin(GL_LINES);
 glVertex2f(.03,0.00);
 glVertex2f(.00,.00);

 glEnd();


 // (red, green, blue)
 glTranslatef(0.00,-0.03,0.00);
 //glColor3f (0.0, 0.0, 1.0);
 glPointSize(4);
 glBegin(GL_POINTS);
 glVertex3f (0.00, 0.08, 0.0);
 glEnd();
 glTranslatef(-0.02,0.00,0.00);
 //glColor3f (0.0, 0.0, 1.0);
 glPointSize(4);
 glBegin(GL_POINTS);
 glVertex3f (0.05, 0.08, 0.0);

 glEnd();
 glTranslatef(-0.05,-0.15,0.00);
 glColor3f (1.0, 0.0, 0.0);
 glBegin(GL_POLYGON);
 //Right hand;
 glVertex2f (0.04, 0.10);
 glVertex2f (0.02, 0.10);
 glVertex2f (0.02, 0.30);
 glVertex2f (0.04, 0.30);
 glEnd();
 glTranslatef(0.10,-0.21,0.00);
 glColor3f (1.0, 0.0, 0.0);
 glBegin(GL_POLYGON);
 //Left hand;
 glVertex2f (0.05, 0.11);
 glVertex2f (0.03, 0.11);
 glVertex2f (0.03, 0.31);
 glVertex2f (0.05, 0.31);
 glEnd();
 glFlush ();
 }
 int main(int argc, char** argv)
 {
 glutInit(&argc, argv);
 glutInitWindowSize (600, 500);
 glutInitWindowPosition (200, 100);
 // Screen origin (0,0) is at Top Left
 glutCreateWindow ("Hello Computer Graphics Students");
 init(); // calling init()
 glutDisplayFunc(display); // glut call back function,
calling display()
 glutMainLoop();
 return 0; // ANSI C requires main to return int.
 }

More Related Content

Similar to Robot by gulnaz

Robot In OpenGL Using Line Function
Robot In OpenGL Using Line Function Robot In OpenGL Using Line Function
Robot In OpenGL Using Line Function Jannat Jamshed
 
Ass day2 2_rotating my name (robi)
Ass day2 2_rotating my name (robi)Ass day2 2_rotating my name (robi)
Ass day2 2_rotating my name (robi)Robi Parvez
 
Tutorial Open GL (Listing Code)
Tutorial Open GL (Listing Code)Tutorial Open GL (Listing Code)
Tutorial Open GL (Listing Code)Aila Gema Safitri
 
computer graphics at openGL
computer graphics at openGLcomputer graphics at openGL
computer graphics at openGLYasir Khan
 
Ass day3 2_olympic logos
Ass day3 2_olympic logosAss day3 2_olympic logos
Ass day3 2_olympic logosRobi Parvez
 
Programa de objetos 3 d wire
Programa de objetos 3 d wirePrograma de objetos 3 d wire
Programa de objetos 3 d wireRené Domínguez
 
#includefloat angle, move, scene, roadmove,turn, on=1; int i, st.docx
#includefloat angle, move, scene, roadmove,turn, on=1; int i, st.docx#includefloat angle, move, scene, roadmove,turn, on=1; int i, st.docx
#includefloat angle, move, scene, roadmove,turn, on=1; int i, st.docxajoy21
 
Computer Graphics and Multimedia lab report
Computer Graphics and Multimedia lab reportComputer Graphics and Multimedia lab report
Computer Graphics and Multimedia lab reportBijoy679
 
square.cpp Open
 square.cpp Open square.cpp Open
square.cpp OpenMikeEly930
 
The Ring programming language version 1.7 book - Part 60 of 196
The Ring programming language version 1.7 book - Part 60 of 196The Ring programming language version 1.7 book - Part 60 of 196
The Ring programming language version 1.7 book - Part 60 of 196Mahmoud Samir Fayed
 
computer graphics at openGL (2)
computer graphics at openGL (2)computer graphics at openGL (2)
computer graphics at openGL (2)Yasir Khan
 
The Ring programming language version 1.5.3 book - Part 65 of 184
The Ring programming language version 1.5.3 book - Part 65 of 184The Ring programming language version 1.5.3 book - Part 65 of 184
The Ring programming language version 1.5.3 book - Part 65 of 184Mahmoud Samir Fayed
 
Robot Motion Source code
Robot Motion Source codeRobot Motion Source code
Robot Motion Source codeBrian Goggins
 
The Ring programming language version 1.9 book - Part 65 of 210
The Ring programming language version 1.9 book - Part 65 of 210The Ring programming language version 1.9 book - Part 65 of 210
The Ring programming language version 1.9 book - Part 65 of 210Mahmoud Samir Fayed
 

Similar to Robot by gulnaz (20)

Robot In OpenGL Using Line Function
Robot In OpenGL Using Line Function Robot In OpenGL Using Line Function
Robot In OpenGL Using Line Function
 
Robot by gulnaz
Robot by gulnazRobot by gulnaz
Robot by gulnaz
 
Ass day2 2_rotating my name (robi)
Ass day2 2_rotating my name (robi)Ass day2 2_rotating my name (robi)
Ass day2 2_rotating my name (robi)
 
Tutorial Open GL (Listing Code)
Tutorial Open GL (Listing Code)Tutorial Open GL (Listing Code)
Tutorial Open GL (Listing Code)
 
computer graphics at openGL
computer graphics at openGLcomputer graphics at openGL
computer graphics at openGL
 
Ass day3 2_olympic logos
Ass day3 2_olympic logosAss day3 2_olympic logos
Ass day3 2_olympic logos
 
Programa de objetos 3 d wire
Programa de objetos 3 d wirePrograma de objetos 3 d wire
Programa de objetos 3 d wire
 
#includefloat angle, move, scene, roadmove,turn, on=1; int i, st.docx
#includefloat angle, move, scene, roadmove,turn, on=1; int i, st.docx#includefloat angle, move, scene, roadmove,turn, on=1; int i, st.docx
#includefloat angle, move, scene, roadmove,turn, on=1; int i, st.docx
 
Development with OpenGL and Qt
Development with OpenGL and QtDevelopment with OpenGL and Qt
Development with OpenGL and Qt
 
Computer Graphics and Multimedia lab report
Computer Graphics and Multimedia lab reportComputer Graphics and Multimedia lab report
Computer Graphics and Multimedia lab report
 
Grafika komputer 2
Grafika komputer 2Grafika komputer 2
Grafika komputer 2
 
Komputer Grafik
Komputer GrafikKomputer Grafik
Komputer Grafik
 
square.cpp Open
 square.cpp Open square.cpp Open
square.cpp Open
 
The Ring programming language version 1.7 book - Part 60 of 196
The Ring programming language version 1.7 book - Part 60 of 196The Ring programming language version 1.7 book - Part 60 of 196
The Ring programming language version 1.7 book - Part 60 of 196
 
Practicing 2d drawing primitives
Practicing 2d drawing primitivesPracticing 2d drawing primitives
Practicing 2d drawing primitives
 
Practica
PracticaPractica
Practica
 
computer graphics at openGL (2)
computer graphics at openGL (2)computer graphics at openGL (2)
computer graphics at openGL (2)
 
The Ring programming language version 1.5.3 book - Part 65 of 184
The Ring programming language version 1.5.3 book - Part 65 of 184The Ring programming language version 1.5.3 book - Part 65 of 184
The Ring programming language version 1.5.3 book - Part 65 of 184
 
Robot Motion Source code
Robot Motion Source codeRobot Motion Source code
Robot Motion Source code
 
The Ring programming language version 1.9 book - Part 65 of 210
The Ring programming language version 1.9 book - Part 65 of 210The Ring programming language version 1.9 book - Part 65 of 210
The Ring programming language version 1.9 book - Part 65 of 210
 

Recently uploaded

21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptxJoelynRubio1
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsSandeep D Chaudhary
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxCeline George
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfDr Vijay Vishwakarma
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17Celine George
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsKarakKing
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Pooja Bhuva
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...Amil baba
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Pooja Bhuva
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jisc
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxPooja Bhuva
 
Basic Intentional Injuries Health Education
Basic Intentional Injuries Health EducationBasic Intentional Injuries Health Education
Basic Intentional Injuries Health EducationNeilDeclaro1
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxDr. Sarita Anand
 

Recently uploaded (20)

21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & Systems
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
Basic Intentional Injuries Health Education
Basic Intentional Injuries Health EducationBasic Intentional Injuries Health Education
Basic Intentional Injuries Health Education
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 

Robot by gulnaz

  • 2.  // CGassignment2.cpp : Making a simple Robot;  //Gulnaz Akhter;  #include "stdafx.h"  // Run by Visual C++ 6 with OpenGL  #include <math.h>  #include <glut.h>  void init (void)  {  /* select clearing (background) color */  glClearColor (0.0, 0.0, 0.0, 1.0);  // (red, green, blue, alpha), used by glClear  /* initialize viewing values */  glMatrixMode(GL_PROJECTION);  glLoadIdentity();  glOrtho(1.0, -1.0, -1.0, 1.0, -1.0, -1.0);  // (left, right, bottom, top, near, far)  }
  • 3.  void display(void)  {    glColor3f (1.0, 0.0, 0.0);  glBegin(GL_POLYGON);  //Head;  glVertex2f (0.08, 0.11);  glVertex2f (0.01, 0.11);  glVertex2f (0.01, 0.20);  glVertex2f (0.08, 0.20);  glEnd();  glTranslatef(-0.01,0.07,0.00);  glTranslatef(0.07,-0.20,0.00);  glColor3f (1.0, 0.0, 0.0);  glBegin(GL_POLYGON);
  • 4.  //Body;  glVertex2f (-0.05, -0.05);  glVertex2f (0.02, -0.05);  glVertex2f (0.02, 0.18);  glVertex2f (-0.05, 0.18);  glEnd();  glTranslatef(-0.04,0.2,0.00);  glColor3f (1.0, 0.0, 0.0);  glBegin(GL_POLYGON);  //Neck;  glVertex2f (0.03, 0.06);  glVertex2f (0.02, 0.06);  glVertex2f (0.02, -0.02);  glVertex2f (0.03, -0.02);  glEnd();
  • 5.  glTranslatef(0.02,-0.56,0.00);  glColor3f (1.0, 0.0, 0.0);  glBegin(GL_POLYGON);  //Right Leg;  glVertex2f (0.04, 0.10);  glVertex2f (0.02, 0.10);  glVertex2f (0.02, 0.30);  glVertex2f (0.04, 0.30);  glEnd();  glTranslatef(-0.06,-0.01,0.00);  glColor3f (1.0, 0.0, 0.0);  glBegin(GL_POLYGON);
  • 6.  //Left Leg;  glVertex2f (0.05, 0.11);  glVertex2f (0.03, 0.11);  glVertex2f (0.03, 0.31);  glVertex2f (0.05, 0.31);  glEnd();  //Mouth  glTranslatef(0.05,0.63,0.00);  glColor3f (0.0, 1.0, 0.0);  glBegin(GL_LINES);  glVertex2f(.03,0.00);  glVertex2f(.00,.00);   glEnd();
  • 7.    // (red, green, blue)  glTranslatef(0.00,-0.03,0.00);  //glColor3f (0.0, 0.0, 1.0);  glPointSize(4);  glBegin(GL_POINTS);  glVertex3f (0.00, 0.08, 0.0);  glEnd();  glTranslatef(-0.02,0.00,0.00);  //glColor3f (0.0, 0.0, 1.0);  glPointSize(4);  glBegin(GL_POINTS);  glVertex3f (0.05, 0.08, 0.0);   glEnd();
  • 8.  glTranslatef(-0.05,-0.15,0.00);  glColor3f (1.0, 0.0, 0.0);  glBegin(GL_POLYGON);  //Right hand;  glVertex2f (0.04, 0.10);  glVertex2f (0.02, 0.10);  glVertex2f (0.02, 0.30);  glVertex2f (0.04, 0.30);  glEnd();  glTranslatef(0.10,-0.21,0.00);  glColor3f (1.0, 0.0, 0.0);  glBegin(GL_POLYGON);  //Left hand;
  • 9.  glVertex2f (0.05, 0.11);  glVertex2f (0.03, 0.11);  glVertex2f (0.03, 0.31);  glVertex2f (0.05, 0.31);  glEnd();  glFlush ();  }  int main(int argc, char** argv)  {  glutInit(&argc, argv);  glutInitWindowSize (600, 500);  glutInitWindowPosition (200, 100);  // Screen origin (0,0) is at Top Left  glutCreateWindow ("Hello Computer Graphics Students");  init(); // calling init()  glutDisplayFunc(display); // glut call back function, calling display()  glutMainLoop();  return 0; // ANSI C requires main to return int.  }