Ver Mensaje Individual
  #1 (permalink)  
Antiguo 14/10/2011, 13:58
Avatar de valentina4you
valentina4you
Colaborador
 
Fecha de Ingreso: agosto-2010
Ubicación: Montevideo
Mensajes: 1.623
Antigüedad: 13 años, 9 meses
Puntos: 285
Alguien que pueda facilitar algún material para hacer estos ejercicios?

Mi primera vez en esta sección. Iré al grano. Estudio informática y una de mis materias es programación. Mi profesor es horriblemente malo enseñando y nadie entiende nada en la clase, nos ha mandado ejercicios para hacer y nadie sabe ni por dónde empezar. Prácticamente no se hacer nada y no quiero perder. Me gustaría saber si alguien pudiera facilitarme alguna información, asumo que básica para poder resolver estos ejercicios. Veo esto y para mi es chino básico, no sé ni que hay que hacer. Quiero creer que es para programar en C+

Si alguien pudiera orientarme un poquito estaría eternamente agradecida. Son para el lunes por lo que estoy con un poquito de apuro para intentar entender en poco tiempo.



Copio algunos ejercicios:

Código HTML:
Ver original
  1. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  2. #include<stdio.h>
  3. #include<conio.h>
  4. void main(){
  5. int cont=1;
  6. clrscr();
  7. do {
  8. printf("%d\t",cont);
  9. cont++;
  10. }while (cont <=10);
  11. getch();
  12. }
  13. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  14. /* Indica la salida del siguiente programa
  15. */
  16. #include<stdio.h>
  17. #include<conio.h>
  18. void main()
  19. {
  20. int x, y, z, w;
  21. clrscr();
  22. x = 3;
  23. y = 7;
  24. z=x+y;
  25. printf("x=%d\t\t y=%d\t\t z=%d\t\t\n", x, y, z);
  26. {
  27. int w, x, z;
  28. printf("w=%d\t\t x=%d\t\t y=%d\t\t z=%d\t\t\n", w, x, y, z);
  29. w = x * 21 + y;
  30. y = w + x / 4;
  31. printf("w=%d\t\t x=%d\t\t y=%d\t\t z=%d\t\t\n", w, x, y, z);
  32. }
  33. x = w * 3;
  34. y = x + y;
  35. printf("w=%d\t\t x=%d\t\t y=%d\t\t z=%d\t\t\n", w, x, y, z);
  36. }
  37.  
  38. /* x=3
  39. y=7
  40. z=10 */
  41. /* w=-601
  42. x=8306
  43. y=7
  44. z=64 */
  45. /* w=-22175
  46. x=8306
  47. y=-20099
  48. z=64 */
  49. /* w=12803
  50. x=-27127
  51. y=18310
  52. z=10 */
  53. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  54. /* Indica la salida del siguiente programa
  55. */
  56. #include<stdio.h>
  57. #include<conio.h>
  58. void main()
  59. {
  60. int x=0, y=0, z=0, w=0;
  61. clrscr();
  62. x = 3;
  63. y = 7;
  64. z=x+y;
  65. printf("x=%d\t\t y=%d\t\t z=%d\t\t\n", x, y, z);
  66. {
  67. int w=0, x=0, z=0;
  68. printf("w=%d\t\t x=%d\t\t y=%d\t\t z=%d\t\t\n", w, x, y, z);
  69. w = x * 21 + y;
  70. y = w + x / 4;
  71. printf("w=%d\t\t x=%d\t\t y=%d\t\t z=%d\t\t\n", w, x, y, z);
  72. }
  73.  
  74. x = w * 3;
  75. y = x + y;
  76. printf("w=%d\t\t x=%d\t\t y=%d\t\t z=%d\t\t\n", w, x, y, z );
  77.  
  78. }
  79. /* x=3
  80. y=7
  81. z=10 */
  82. /* w=0
  83. x=0
  84. y=7
  85. z=0 */
  86. /* w=7
  87. x=0
  88. y=7
  89. z=0 */
  90. /* w=0
  91. x=0
  92. y=7
  93. z=10 */
  94. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  95. #include<stdio.h>
  96. #include<conio.h>
  97. void main(){
  98. unsigned char i;
  99. clrscr();
  100. for(i=32;i<=255 && i>0 ;i++)
  101. printf("%3u=%c\t",i,i);
  102. }
  103. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  104. #include<stdio.h>
  105. #include<conio.h>
  106. void main(){
  107. int n, i;
  108. int suma;
  109. clrscr();
  110. printf("Ingrese hasta que n£mero desea sumar\n");
  111. scanf("%d", &n);
  112. suma=0;
  113. for(i=0;i<=n;i++){
  114. suma=suma+i;
  115. }
  116. printf("SUMA DESDE 0 HASTA %d es %d \n",n,suma);
  117. getch();
  118. }
  119. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  120. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  121. #include<stdio.h>
  122. #include<conio.h>
  123. void main(){
  124. int i,vector[10];
  125. clrscr();
  126. printf("Imprimo el contenido del vector antes de inicializarlo.\n\n");
  127. for(i= 0; i<=9; i++){
  128. printf("%d\t",vector[i]);
  129. }
  130. printf("\n\n\n");
  131. // Inicializo el vector.
  132. for(i= 0; i<=9; i++){
  133. vector[i]=0;
  134. }
  135. printf("Imprimo el contenido del vector despu‚s de inicializarlo.\n\n");
  136. for(i= 0; i<=9; i++){
  137. printf("%d\t",vector[i]);
  138. }
  139. getch();
  140. }
  141.  
  142.  
  143.  
  144. #include<stdio.h>
  145. void main(){
  146. int m, cont=0;
  147. for(m=1;m<100;m+=2)
  148. {
  149.  
  150. cont++;
  151. printf("%d\n",m);
  152.  
  153. }
  154. printf("%d",cont);
  155. }
  156. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#include<stdio.h>
  157. #include<conio.h>
  158. void main(){
  159. char car;
  160. clrscr();
  161. while (car!=EOF) {
  162. // CTRL Z indican fin de archivo
  163. putchar(car=getchar());
  164. }
  165. }
  166. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  167. #include<stdio.h>
  168. #include<conio.h>
  169. void main(){
  170. char car;
  171. int ncar=0;
  172. // acumulador de caracteres.
  173. int nlineas=0; //acumulador de lineas.
  174. clrscr();
  175. while ((car=getchar())!=EOF) {
  176. // CTRL Z indican fin de archivo
  177.  
  178. if (car=='\n')
  179. nlineas++;
  180. else
  181. ncar++;
  182. }
  183.  
  184. printf("La cantidad de caracteres ingresados fueron: %d\n", ncar);
  185. printf("La cantidad de lineas ingresadas fueron: %d\n", nlineas);
  186. getch();
  187. }
  188.  
  189. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  190. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  191. #include<stdio.h>
  192. #include<conio.h>
  193. #define TAMANIO 100
  194. void main(){
  195. char veccar[TAMANIO];
  196. char car;
  197. int i;
  198. clrscr();
  199. i=0;
  200. printf ("Escriba la oracion\n");
  201. while (((car=getchar())!=EOF) && (car!='\n')) {
  202. veccar[i]=car;
  203. i++;
  204. }
  205. veccar[i]='\0'; // para indicar fin de cadena.
  206.  
  207. for (i=0;i<TAMANIO;i++)
  208. printf("%c", veccar[i]);
  209. getch();
  210. }

Desde ya muchas gracias.
__________________
Diseño Gráfico Profesional
www.valenn.com | Sigueme @valenncom | facebook/valenncom