You are on page 1of 2

#include <stdio.h> #include <stdio.

h>

#include <stdlib.h> #include <stdlib.h>

//swapping style

void hello() void swap (int x, int y)

{ {

printf("Hello world!\n"); int temp;

//return 0; - for int and float.. temp = a;

} a = b;

int main() b = temp; //xy -> yx by using temp

int a; printf("%d %d\n",a, b);

hello(); }

printf("value is ");

scanf("%d",&a); int main()

hello(); {

return 0; int x = 3, y = 5;

} printf("%d %d\n",x, y);

swap (x,y);

printf("%d %d\n",x, y); //function use void..thus it


doesnt return any value (x=3,y=5)

return 0;

}
int shocked()

Face mode {

/*printf("\nshocked face\n"); printf("\nshocked face\n");

printf("\n@ @\n"); printf("\n@ @\n");

printf(" O \n"); printf(" O \n\n");

printf("\n"); return 0;

printf("\nhappy face\n");

printf("\n^ ^\n "); void happy()

printf("_\n\n"); {

printf("\nhappy face\n");

printf("\nsad face\n"); printf("\n^ ^\n ");

printf("\n* *\n"); printf("_\n\n"); //no return 0

printf(" _\n\n");*/ }

#include <stdio.h>

#include <stdlib.h> float sad()

//face mode using function printf("\nsad face\n");

int main() printf("\n* *\n");

{ printf(" _\n\n");

shocked(); return 0;

happy(); }

sad();

return 0;

You might also like