SHARE
TWEET

Untitled

a guest Sep 15th, 2017 129 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. int main(){
  2.  
  3. //Declaración funciones
  4.     int entero();
  5.     float flt();
  6.     double dlb();
  7.     char chr();
  8.  
  9.     char eltexto();
  10.     char a = eltexto();
  11.     //
  12.  
  13.     printf("  =============================================  \n");
  14.     printf("-=BIENVENIDO AL PROGRAMA DE METODOS Y FUNCIONES=-\n");
  15.     printf("  =============================================  ");
  16.     printf("\n");
  17.  
  18. //Funcines
  19.    printf("\nEl valor de la funcion 1 es: %i\n",entero());
  20.    printf("\nEl valor de la funcion 2 es: %.2f\n",flt());
  21.    printf("\nEl valor de la funcion 3 es: %f\n",dlb());
  22.    printf("\nEl valor de la funcion 4 es: %c\n",chr());
  23.    printf("\nEl valor de la funcion 5 es: %s\n",a);
  24.  
  25.    printf("  \n=============================================  \n");
  26.  
  27. //Metodos
  28.     enterof();
  29.     flft();
  30.     dlbf();
  31.     chrf();
  32.     strf();
  33.  
  34.     return 0;
  35. }
  36.  
  37. //Funciones
  38. int entero(){
  39.     int a = 4;
  40.     return a;
  41. }
  42. float flt(){
  43.     float a = 3.18;
  44.     return a;
  45. }
  46. double dlb(){
  47.     double a = 65.00814;
  48.     return a;
  49. }
  50. char chr(){
  51.     char a = 'A';
  52.     return a;
  53. }
  54. char eltexto(){
  55.     char name[20] = "Enrique";
  56.     return name;
  57. }
  58.  
  59. //Metodos
  60. void enterof(){
  61.     int a = 4;
  62.     printf("\nEl valor del metodo 1 es: %i\n",a);
  63. }
  64. void flft(){
  65.     float a = 3.18;
  66.     printf("\nEl valor del metodo 2 es: %f\n",a);
  67. }
  68. void dlbf(){
  69.     double a = 65.00814;
  70.     printf("\nEl valor del metodo 3 es: %f\n",a);
  71. }
  72. void chrf(){
  73.     char a = 'A';
  74.     printf("\nEl valor del metodo 4 es: %c\n",a);
  75. }
  76. void strf(){
  77.     char a[20] = "Enrique";
  78.     printf("\nEl valor del metodo 5 es: %s\n",a);
  79. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top