Name addition of integers Student Name Chandra Prakash UID 11121415 Section

Name addition of integers student name chandra

This preview shows page 23 - 28 out of 28 pages.

/*Prog. Name: addition of integers Student Name: Chandra Prakash UID: 11121415 Section: M4571 */ #include<stdio.h> #include<conio.h> int main() { }
Image of page 23
©LPU CSE101 C Programming Header files The next two lines are command for including header files These two lines must be included in every C program stdio.h : standard input output header file for functions printf() , scanf() ,... and so on conio.h : console input output header file for functions getch() …. and so on Here ‘ # ‘ is called preprocessor directive
Image of page 24
©LPU CSE101 C Programming Header files Ferrari car as output //Sample program #include<stdio.h> //header file for printf() #include<conio.h> //header file for getch() int main() { //stdio.h is providing printf() function printf(“Car is under process”); //conio.h is providing getch() function getch(); } Real life example C code example Output: Car is under process
Image of page 25
©LPU CSE101 C Programming Function main() as special function, execution starts from here A program must have a single main() function A program without main() function wont work main() function will call other functions
Image of page 26
©LPU CSE101 C Programming main function in real life Real life example C code example Before driving the car, we must start the car, a car won’t be driven without starting //Prog. Name: display name #include<stdio.h> #include<conio.h> int main() { printf(“My name is Aman”); getch(); } Similarly our program must have a main function to start a program Output: My name is Aman
Image of page 27
©LPU CSE101 C Programming [email protected] Next Class: Components of C Identifier and Keywords Data Type
Image of page 28

You've reached the end of your free preview.

Want to read all 28 pages?

  • Spring '18
  • Aman

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes
A+ icon
Ask Expert Tutors