Finding C programming hard? We’ve got you! 🚀Get 60% off on Programiz PRO Lifetime Plan this Black Friday-pay once for skills that last forever. Don’t miss out, it’s a limited-time offer! 👉Grab your discount now: bit.ly/blkfriday-24-yt
@AbhiramDeshpande-fe1vi Жыл бұрын
#include int main() { // Write C code here double salary = 25000; double* ptr=&salary; printf("adress:%p ",ptr); printf(" value :%.2lf",*ptr*2); return 0; }
@anommaharjan30052 жыл бұрын
I never really understood what pointer was, but my doubts and confusions were cleared out by this video. Thank you team Programiz for the wonderful and well-explained video.
@3dohd Жыл бұрын
Same - For some reason seeing the memory location printed on screen made a light bulb go off for me
@tshedzanembilwi45723 ай бұрын
Thank you team Programiz I understand so much now that I’m going through these tutorials
@anonymouszn49782 жыл бұрын
Answer : Option C (*p = a)
@zindycangaming98512 ай бұрын
Correcto!
@kharlopena7512 Жыл бұрын
This is most cohesive explanation of pointers I've seen online. Thank you!
@nihatdonmzov4166 Жыл бұрын
The programming task: #include int main(){ double salary; printf("Enter the salary: "); scanf("%lf", &salary); double* var = &salary; printf("%.1lf", *var); *var = 2 * *var; printf(" The new salary is %lf", *var); }
@gamerxx6344Ай бұрын
it should be double* var = salary; and *var =2*var;
@yashjewdhun768911 күн бұрын
@@gamerxx6344 no
@kaseemkhan39192 жыл бұрын
This C programming playlist is helping me so much to learn all this concepts in very easy and adaptive manner ! Thank you programiz for this
@shuvadeepsil25134 ай бұрын
I was totally confused while learning pointers in C. Other KZbin videos on this topic were not easy and comprehensive enough for me to understand. After watching this video all of my doubts regarding pointers were cleared. Thank You Programiz!!! ❤
@user-nt4nm4fb3u10 ай бұрын
Hats off for this wonderful explanation on the topic Pointers which I so badly wanted to know how it works. Thank you
the ans is #include int main(void) { double salary; double* pointer = &salary; scanf("%lf", pointer); //DONT* cuse scanf puts value INTO &salary(memory address of salary), but POINTER IS ALR ADDRESS OF IT printf("%lf", salary); }
your app is really good with that style of interface and layout 👍
@light-warrior9 ай бұрын
TASK: #include int main() { double salary; printf("Enter your monthly salary: "); scanf(" %lf", &salary); double* ptr = &salary; //assigning the adress of salary to the double pointer *ptr = salary; //assigning the value of the salary to the value stored in the pointer printf(" Your salary before change: % lf", *ptr); *ptr = 2 * salary; printf(" Your new salary after the salary increase: %lf", *ptr); return 0; } C is the correct option because *p shows us the value stored in pointer and a is also showing us the value of the variable.
Thanks u so much mam , your way of explanation was awesome 👌 and i just learned pointer very easily
@kalu-kelechi-kalu Жыл бұрын
Crystal clear
@jaysanga59819 ай бұрын
Answer is only c bcz *p=&a ; means dereference of p is cant store address , p=*a its wrong and *p =a; means it store value in address of what a had so address remain same but it change value in that address
@Manikanta-wz2rl Жыл бұрын
#include int main() { double sal; double* ptr = &sal; printf("enter the salary:"); scanf("%lf",&sal); printf("salary:%.2lf",*ptr); double sal1 = sal * 2; printf(" Double_Salary:%.2lf",sal1); return 0; }
@allthingsmoney70892 жыл бұрын
Very helpful. Thank you.
@b7sh_b7sh Жыл бұрын
amazing teacher😍😍
@NantongoLindah Жыл бұрын
I am in need of help abt the exercise given
@prajwal_bagewadi2 жыл бұрын
very awesome video very very enlightening ❤❤❤❤❤❤❤❤🙏
@interneter7 ай бұрын
Great !
@Jarawain_Kharpran Жыл бұрын
Thnx
@Ech-chatouiMohammed2 ай бұрын
c'est très utile
@zawnaing344 Жыл бұрын
thanks
@thiagaodavez5465 Жыл бұрын
tankis madam
@annapopova3221 Жыл бұрын
perfect
@sushilgbp Жыл бұрын
thank u
@endeavored2 жыл бұрын
/* Program to change value of a variable using pointer. Instructions: Get input value for a double variable named salary, Assign the address of salary to a double pointer. Use pointer to print value of salary, increase salary by 2 times and print new salary. */ #include int main() { double salary; printf("Enter Salary: "); scanf("%lf", &salary); double* ptr = &salary; printf("Salary = %.1lf ", *ptr); *ptr = salary * 2; printf("Salary doubled = %.1lf", *ptr); return 0; }
@more_harsh2 жыл бұрын
seems correct to me atleast
@nsfw_metaMorph21 Жыл бұрын
Could have given salary in the last printf() as the value is already changed
@karamking64042 жыл бұрын
thanks for your explanation but what is the best way to learn c programming?
@t3bld846 Жыл бұрын
practice leetcode daily bro
@AFCOE Жыл бұрын
Practice
@godswillnnachionu2 жыл бұрын
Great
@ssentamualvinjacob11912 жыл бұрын
hey would really hope to see a code to calculate CGPA
@livehopeskul11572 жыл бұрын
Option C
@sejalbansal486 Жыл бұрын
there will be no error coming by using *ptr instead of * ptr, she write %d that why the value came instead of address
double salary = 39.500; double* ptr; ptr = &salary; printf("The salary is %.3lf ", *ptr); salary = 50.000; printf("The new salary is %.3lf", *ptr);
@DCSDilshadAhmad Жыл бұрын
Option (c) is correct.
@rajumalekar2 жыл бұрын
Thank you for the app
@vishalkirthik9148 Жыл бұрын
#include int main(){ float a; printf("Enter the salary"); scanf("%f",&a); float* ptr=&a; printf(" The value of salary is %f",*ptr); *ptr=*ptr*2; printf(" The value of salary is %f",*ptr); return 0; }
@bryanborigas3802 жыл бұрын
nice
@lzii91272 жыл бұрын
c is the correct answer i guess
@imveryscawed7 ай бұрын
I didn't know there is a app, that's good for mw
@deepakkushwahaji31092 жыл бұрын
English में तो सब study करवाते है हिंदी में भी करवा दीजिये,, हम हिंदी मीडियम लोग भी programing करना चाहते है
@akshaybagalkotkar78332 жыл бұрын
Tumse na ho payega, tum bhais charao.
@lemichael20042 жыл бұрын
#include int main (){ double *pointer ,salary,newSalary ; printf ("Enter your salary: "); scanf ("%lf",&salary); pointer = &salary; printf ("Value of salary =%.2lf",*pointer); newSalary = salary*2; pointer =&newSalary; printf (" Value of new Salary =%.2lf ",*pointer); return 0; } Answer of the quiz : C because *p is value , a is value so --> value =value . Thank you so much for your free lesson
I didnt understand the dufference int* ptr and int *ptr? int age=24; int* ptr=&age; printf("%p",&age); printf(" %p",ptr); printf(" value%d",*ptr); //24 int *ptr1=&age; printf(" value1 %d",*ptr1); //24 return 0; it gives same result above for both syntax
@abdulmateenalabi6063 Жыл бұрын
int* ptr = &age; ----- is the correct way to do it as int* is making ptr a pointer. While int *ptr = &age ------ is wrong for pointing to the address because *ptr is to access the value of a variable and not address. With what you did you assigned a value variable to an address which is wrong, but since you used a value variable you will get a value instead of an address and from your last code if you try accessing your address you will not get the address.
@ananducs56226 ай бұрын
@@abdulmateenalabi6063 will get address
@tibish5 ай бұрын
there is no difference from the compile's stand point. both will be seen in the same way. From a code clarity perspective there is a big difference. For example, if you see this line: int* ptr1, ptr2, you would tend to think that both are pointers, but you would be wrong as only ptr1 is a pointer, ptr2 is just a simple int. On the other hand if you see this line: int *ptr1, *ptr2 it is immediately clear that both ptr are pointers.
@Azizam-j3c Жыл бұрын
//Solution. #include int main() { double salary; printf("enter the salary: "); scanf("%lf", &salary); double* salptr = &salary; printf("the value of the salary pointer is: %0.2lf ", *salptr); *salptr*=2; printf("the new value is: %0.2lf ", *salptr); }