Your SlideShare is downloading. ×
Algoritmica i clase06 practica 6
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Saving this for later?

Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime - even offline.

Text the download link to your phone

Standard text messaging rates apply

Algoritmica i clase06 practica 6

68
views

Published on


0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
68
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. UNMSM – FISI Algorítmica I Práctica N° 6 Punteros Problema 1: ¿ Cuál es el valor final de „x‟ ? int x = 5; x +=2; int *ap1=&x; *ap1 = x + *ap1; int *ap2 = ap1; *ap1 = 2*(*ap2)/(*ap1); cout<<”El valor de x es “<<x; Problema 2 : ¿Cuál es el resultado de las siguientes operaciones? int *p , a; ptr = &a; a = a + 10; *ptr = *ptr + 10; if ( a < 20 ) { cout<<”a es menor que 20”; } else { cout<<”a es mayor que 20”; } Problema 3 : ¿Qué se imprime? int a , b , c , *p1 , *p2; p1 = &a; *p1 = 1; p2 = &b; *p2 = 2; p1 = p2; *p1 = 0; p2 = &c; *p2 = 3; *p1 = 1; cout<<”El valor de a es :“<<a; cout<<”nEl valor de b es :“<<b; cout<<”nEl valor de c es :“<<c; UNMSM-FISI 1