Lecture38 - Tobediscussedtoday User-Defined Functions...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
1 Computer Programming I TA C162 . 17 Apr 2006 To be discussed today…. . User-Defined Functions Examples Functions with no arguments and no return value Functions with arguments and no return value Functions with arguments and return value Functions with no arguments but returns a value Passing Array as an argument to a function One dimensional Two dimensional Strings
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 Computer Programming I TA C162 . 17 Apr 2006 Functions with no arguments and no return value void displayline(void); void main() { displayline(); sum(); } void displayline() { int j; printf(“*”); } void sum() {int a,b; printf(“Enter a and b\n”); scanf(“%d %d”,&a,&b); printf(“Sum = %d ”,(a+b)); } Calling function Called functions
Background image of page 2
3 Computer Programming I TA C162 . 17 Apr 2006 Functions with arguments and no return value void displayline(char); void Sum(float, float); void main() { char c; float a,b; printf(“Enter character to print in line\n”); scanf(“%c”,&ch); displayline(ch); printf(“Enter value of a and b\n”); scanf(“%f %f”,&a,&b); Sum(a,b); }
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 05/14/2010 for the course CS SS ZG653 taught by Professor Shanta during the Spring '09 term at Birla Institute of Technology & Science.

Page1 / 14

Lecture38 - Tobediscussedtoday User-Defined Functions...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online