# Lecture38 - Tobediscussedtoday User-Defined Functions...

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

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

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

View Full Document
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
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); }

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

View Full Document
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
Ask a homework question - tutors are online