C Programming (Important Questions Set 2)

Поділитися
Вставка
  • Опубліковано 2 гру 2024

КОМЕНТАРІ • 239

  • @mfkman
    @mfkman 5 років тому +85

    The 0 thing for octal, i ran into that in production code once and it took me at least 30 minutes to figure it out. What happened was that to align various #defines in source code so that they look pretty, someone put a bunch of zeros in front of the numbers so everything lines up in the code and starts at the same column. The code was misbehaving in a weird way. After staring at the code for 20 minutes and finding seemingly nothing wrong with it, I fired up the debugger, went through the various actions to get to the code in question (this took 10 minutes) and only in a debugger after loading the value and seeing the wrong value in memory, by seeing what the value loaded was, I immediately realized it must be interpreting it as octal. I will never forget this! Hex is 0x, Binary is 0b, why not 0o for Octal? I love C++ (I know this is C) but having a plain zero mean octal is just insane...

    • @PhrontDoor
      @PhrontDoor 5 років тому +10

      It was a resolutely stupid decision for C designers to try to mangle actual math that way.
      In fact it's a design choice literally forcing C code to be 'bad code' by hiding bugs in plain sight. Anyone that I see doing those things in code-reviews gets mandatory C tutorial reassignments where I work.

  • @AnkitSharma-oq4wi
    @AnkitSharma-oq4wi 5 років тому +123

    Such a valuable knowledge sir I didn't know that before truly speaking

  • @shwetakadgi9225
    @shwetakadgi9225 5 років тому +34

    Love you Neso Academy ❤
    Edit : I hope you know how much easy you are making an engineering student's life !!! Thanks a million !!!!

    • @sanmatipol3201
      @sanmatipol3201 4 роки тому

      How should I get the complete series of this from starting. I have get only single videos of different series no.
      Please help me to get this series. 🙏

    • @Jkt61205
      @Jkt61205 4 роки тому +1

      @@sanmatipol3201 search Neso Academy c programming,you will get neso academy playlist containing 226 videos.hope this helps you😀😀

    • @jainsahab8549
      @jainsahab8549 4 роки тому

      @@Jkt61205 bhai tell me which is best between ravindra babu rabula vs neso academy

    • @Jkt61205
      @Jkt61205 4 роки тому +1

      @@jainsahab8549 i saw that channel after you said bhai, it is also very good. in my opinion, neso academy teaches you from very basic(i does not mean that other channels doesn't teach good)but other channels teach good for students who already know basics of c language . i am 12 years old, before starting this course i don't a inch about c language, but because of neso academy even without knowing the basics, i understand each and every point sir tell. this is my opinion , now you can choose what is best for you. if you know basics, go for ravindra babu ravula, but if you want each and every point clearly from basics, go for neso academy. i hope this helps you😁😁

    • @azarathvalisheik9263
      @azarathvalisheik9263 3 роки тому

      @@Jkt61205 Okk bro..Thanks for Suggestion.

  • @ishpreetsingh4255
    @ishpreetsingh4255 5 років тому +19

    Woh. That’s something I don’t know before. Great logic.

  • @JackVaileon
    @JackVaileon 10 місяців тому +2

    Well, the real quality education is here. I really appreciate you all. Thanks a lot from Myanmar❤️

  • @Kim-rh9gt
    @Kim-rh9gt 3 роки тому +9

    nice video and lesson, has increased my understanding of C language

  • @shreyeah-t9f
    @shreyeah-t9f 24 дні тому

    0:53 0 before integer is treated as an octal value

  • @MohankumarV-cb8rv
    @MohankumarV-cb8rv 3 роки тому +5

    what is the output for this c program?
    #include
    #define STRING "%s
    "
    #define NESO "Welcome to Neso academy"
    int main()
    {
    printf(" Welcome to Neso Academy! " STRING, NESO ) ;
    return 0;
    }

  • @sundarshyam7361
    @sundarshyam7361 4 роки тому +6

    Sir your teaching style is awesome 🥰🥰

  • @deepakbhardwaj3141
    @deepakbhardwaj3141 6 років тому +9

    Question series is the best parts ever sir and thanku .........

    • @sanmatipol3201
      @sanmatipol3201 4 роки тому

      Where from can I get the Q&A series.. Can you tell me please 🙏

  • @lxathu
    @lxathu 4 роки тому +5

    I think when 52 octal is written with %o, it's not fortunate to pronounce the displayed 52 as fifty-two. It's misleading, especially for the beginners. That number has nothing to do with the number we know as the sum of five times ten plus two times one.
    It's just "five-two (octal)".

  • @tej_rasane_9
    @tej_rasane_9 Рік тому +1

    Best part of the videos is the explanation 💖💖for all the answers which arent provided by other channels; ❤❤

  • @soranarapiteanu3915
    @soranarapiteanu3915 3 роки тому +5

    You're doing a great job explaining this stuff! ^^

  • @max.caimits
    @max.caimits 5 років тому +2

    I thought it would be a compile error, for printf won't be found. But it's just a warning without #include

  • @sandeeppadamatinti
    @sandeeppadamatinti Місяць тому +1

    Which one is better neso or code with Harry.
    A) neso
    B) code with Harry

  • @48_subhambanerjee22
    @48_subhambanerjee22 2 роки тому +1

    neso academy.. thanks.. these questions were very tricky indeed

  • @abhishekmane3144
    @abhishekmane3144 5 років тому +2

    please add content like computer algorithm, compiler construction, Computer
    Organization and Architecture, Machine Learning

  • @muktadir-us-saleheen9133
    @muktadir-us-saleheen9133 4 роки тому +2

    The questions were very good and I really enjoyed it.

  • @UTTAMKUMAR-gt8fj
    @UTTAMKUMAR-gt8fj 2 роки тому

    I would like to say thank you so much to nesho academy .
    I could not understand in my college during first year when i found this channel then i have been started learning c language and after watching all videos i have become as like master of c so once again thank u so much sir jee love u to all faculties of nesho academy

  • @compangit1524
    @compangit1524 Рік тому

    Comment for myself: putting 0 in front of an integer variable translates that number into an octal value. This is true if the variable is to be printed as a decimal. If it's "%o", and the value is an octal, then it prints normally.

  • @manishmalviya4561
    @manishmalviya4561 5 років тому +1

    Its a valuable knowledge I did not know this basicbknoweldge

  • @debashisjena6836
    @debashisjena6836 4 роки тому +1

    Your channel is just awesome ....

  • @shirleyachara3809
    @shirleyachara3809 3 роки тому +1

    Excellent questions and well explained answers, thanks.

  • @niveshduppalapudi6616
    @niveshduppalapudi6616 5 років тому +6

    Awesome ..... I m now totally interested in the subject

  • @KrittibasBairagi
    @KrittibasBairagi 6 років тому +3

    Please upload "analog and digital communication"

  • @DridhaNishchay
    @DridhaNishchay 3 роки тому +2

    Sir, from where you get such amazing questions!!

  • @shubhamaggarwal3521
    @shubhamaggarwal3521 4 роки тому +1

    please suggest a book from where we can practice quetion and test our knowledge.

  • @kamleshpatil1959
    @kamleshpatil1959 6 років тому +7

    waaaw what a great video...

  • @revolverop598
    @revolverop598 3 роки тому

    2:34 Why is there no need of #Include ?

  • @sumitkr233
    @sumitkr233 5 років тому +2

    Thank you sir for giving a meaningful information ..
    Sir can you make videos on java

  • @anirbandas4985
    @anirbandas4985 5 років тому +3

    I think "%s" prints the string as long as it gets a space.....so the answer should be Welcome only......plz correct me if I am wrong.

    • @myb3068
      @myb3068 5 років тому +1

      When a string is made in c programming it is made as an array of characters, including the spaces, and finished with null ('/0'). Printf reads the string with %s to this null character and thats its indication that it is done printing. So i does not end on a whitespace but rather a null character

    • @myb3068
      @myb3068 5 років тому +4

      its very important to note the difference between a whitespace character (' ') and a null character ('/0')

  • @puzzledleader
    @puzzledleader 5 років тому +4

    love you neso academy

    • @puzzledleader
      @puzzledleader 5 років тому

      Thanks for the like man means a lot please help us with more videos or a complete tutorial session

  • @vijaychodisetti8124
    @vijaychodisetti8124 4 роки тому +1

    Q1 ---42 o decimal values

  • @HarshSharma-mu2yh
    @HarshSharma-mu2yh 5 років тому +4

    Sir please make tutorial on TCL/TK no you tuber uploaded the video regarding TCL

  • @madhaviyalagam2158
    @madhaviyalagam2158 5 років тому +2

    Sir i think that is compiler error becoz to print "welcome to neso academi!" No need of use %s
    .sir plz clarify my doubt
    If we want use"℅s
    " the 2nd parameter should be NESO only dont want to replace with "welcome to neso academi!".then only the string will be printed in the o/p otherwise it raise an error.

    • @josefaschwanden1502
      @josefaschwanden1502 5 років тому

      No it will work because NESO is actually string because in its definition its written in " ".

  • @tej_rasane_9
    @tej_rasane_9 Рік тому

    videos are awesome❤❤😍😍 . Please make more videos on each topics. 👍👍

  • @abdirahmanfarah4886
    @abdirahmanfarah4886 4 роки тому +2

    thank you brother

  • @shreedharchavan7033
    @shreedharchavan7033 3 роки тому

    Excellent video

  • @mrcobalt124
    @mrcobalt124 5 років тому +38

    The first problem would actually cause a Compiler error, because the include for stdio is not there

    • @iampro_grammer5917
      @iampro_grammer5917 5 років тому

      yea you right hahah

    • @vmod3985
      @vmod3985 5 років тому

      not compile error, but a warning

    • @mrcobalt124
      @mrcobalt124 5 років тому

      @@vmod3985 Yeahh Compiler warning, linker error I believe

    • @TheDuckPox
      @TheDuckPox 4 роки тому +1

      yea, except the compiler made mitigation for it. which still makes it a compiler error. i hate it when a question gives that "error" option but didn't think it through

    • @감귤-u6l8d
      @감귤-u6l8d 4 роки тому

      doesn't it depends on whether you wrote -Werror or not if you run your program with a terminal ?

  • @madhamanish8959
    @madhamanish8959 5 років тому +1

    Very useful for us
    .. thanks for posting

  • @sasikumartangala5001
    @sasikumartangala5001 6 років тому +5

    Tq sir wounderful collection of questions

  • @aarushsood3090
    @aarushsood3090 4 роки тому +2

    In code blocks v 20.03 it shows compilation error for the octal value questions..even with %o

  • @mohamedelprins7059
    @mohamedelprins7059 4 роки тому

    #include
    #define STRING "%s
    "
    #define NESO "Welome to Neso "
    int main()
    {
    printf(STRING);
    return 0;



    }
    OUTPUT
    PE //WHY !!

  • @srikarrepaka5023
    @srikarrepaka5023 4 роки тому

    2:06
    3:17
    5:45

  • @Pritamdas-bg7fp
    @Pritamdas-bg7fp 6 років тому +1

    sir make video on various keyword used in c like enum function

  • @dharanisri7057
    @dharanisri7057 6 років тому +1

    Good explanation

  • @rakeshgiri6750
    @rakeshgiri6750 2 роки тому

    Your contents are amazing 🥰🥰🥰.

  • @spiderjuice9874
    @spiderjuice9874 5 років тому +1

    I found your discussion of octal numbers interesting as I didn't know any of that! Unfortunately, I have no real need to ever use octal numbers but I do have frequent needs to use binary numbers. I know that 0xFF is hexadecimal 'FF' = 255, and now I know that 052 is octal '52' = 42, but can we do similar with binaries? "%b" seems not to work when I have tried it. Is there a method to format binary numbers in this way?

  • @vij838
    @vij838 3 роки тому

    Thanks sir for this video

  • @MoAdel92
    @MoAdel92 5 років тому +2

    Thanks a lot

  • @biswajitmoharana2390
    @biswajitmoharana2390 5 років тому +1

    Excellent

  • @sumainakyasar8857
    @sumainakyasar8857 2 роки тому

    Sir,
    the last question is regarding the macro substitution. After substitution, the printf() be like printf(%s
    , welcome to neso academy). As per the syntax of printf(), Shouldn't we write the control strings in double quotes like printf("%s
    ", welcome to neso academy);? Then won't it show compiler error?

  • @nehadave7773
    @nehadave7773 5 років тому

    Very useful.. thanks

  • @AdunHerself
    @AdunHerself Рік тому

    We love you Neso

  • @user-mi8ew2to8e
    @user-mi8ew2to8e 5 років тому +1

    Awesome questions man!

  • @tannishthasengupta7353
    @tannishthasengupta7353 5 років тому +2

    Sir, when we place 0 in front of any decimal number then it is treated as an octal number. Is there any other case for hexadecimal number????

    • @frit00701
      @frit00701 4 роки тому +1

      0x1F is a hexadecimal value

    • @tannishthasengupta7353
      @tannishthasengupta7353 4 роки тому

      @@frit00701 okay

    • @duggirambabu7792
      @duggirambabu7792 3 роки тому

      @@tannishthasengupta7353
      Binary number = 101010
      Octal number = 052
      Decimal number = 42
      Hexadecimal number = 0x2A

  • @HardikPatel-wj8wo
    @HardikPatel-wj8wo 6 років тому +2

    Sir microprocessor ke upar video banao please

  • @mandadibhargav7049
    @mandadibhargav7049 5 років тому +1

    Really awesome tq

  • @garimasrivastava3843
    @garimasrivastava3843 3 роки тому

    Hindi m bhi btaya kariye sir
    U r the best teacher..

  • @kishors8200
    @kishors8200 4 роки тому

    Super video bro

  • @renusindhu1393
    @renusindhu1393 5 років тому

    Very good tricks thank you...

  • @niveditanaik1490
    @niveditanaik1490 5 років тому

    very nice sir👌

  • @jyothireddypalempalli118
    @jyothireddypalempalli118 3 роки тому

    u are really awesome sir

  • @koppoluharitha1090
    @koppoluharitha1090 5 років тому +1

    Thank you sir

  • @suvethar8726
    @suvethar8726 6 років тому

    Tq this video is very useful

  • @librarian1791
    @librarian1791 5 років тому +2

    Bro we use reference operator before the printf variable

    • @SGTkrusha
      @SGTkrusha 5 років тому +1

      Only for variables not macros

    • @neonz2712
      @neonz2712 5 років тому +2

      He made a mistake on the first question, but on the other ones it's not used because the parameters are accessing a macro definition. Not a variable.

    • @happyhappyguy5034
      @happyhappyguy5034 5 років тому

      No printf doesn't require the address of the variable, but scanf does

  • @teknathjha227
    @teknathjha227 4 роки тому

    It was helpful

  • @salonigupta1526
    @salonigupta1526 4 роки тому

    totally liked it

  • @Aishwarya1405-w9m
    @Aishwarya1405-w9m 5 років тому +1

    Will it be important for gate prep too??

  • @nidasiddqui8632
    @nidasiddqui8632 5 років тому

    I used printf, scanf and again printf function in a one line it give a correct output but the function are not work correctly
    Ex:printf("enter the two no",scanf("%d%d",&a, &b,printf(c="%d",a+b)));
    Output:it firstly take two number after it used display function and then it give the output which is correct
    I want to know that why it take two no. First and display and it give Final output

  • @alquinn8576
    @alquinn8576 4 роки тому

    so this was the program the computer in Hitchhiker's Guide was running?

  • @true4189
    @true4189 4 роки тому

    Thank u

  • @mineemisha1875
    @mineemisha1875 5 років тому +2

    sr hw it is octal value?

  • @Miltiades178
    @Miltiades178 5 років тому +11

    *WHY ON EARTH DID I GET THAT IN MY RECOMMEND LIST?*
    BTW THANKS FOR THE FACTS

  • @Vijay-uc5yd
    @Vijay-uc5yd 5 років тому

    Nice video 😲

  • @05t4subramanyam4
    @05t4subramanyam4 3 роки тому

    Sir but you told that printf not only prints the string but it also prints the noof characters on the console screen in previous videos

  • @nikithak1796
    @nikithak1796 6 років тому +1

    Spr clarity..it's really very understandable☺..plz make the videos in c++,java programs also

  • @rahilumar3002
    @rahilumar3002 6 років тому +2

    Completely impressed keep continue sir luv u

  • @rafapaprocki7147
    @rafapaprocki7147 5 років тому

    Very easy

  • @kushbind8207
    @kushbind8207 5 років тому

    Well, I thought scanf() and printf() won't Handel multi-word string that's why we use puts() and gets() if wrong please correct me 😇😇😇....

    • @prathamshah2854
      @prathamshah2854 5 років тому

      Printf can handle multiple words only scanf cannot

  • @CP-du4uv
    @CP-du4uv 3 роки тому +1

    So basically what I'm thinking can never be the answer, then I'm left with three options, Alright!!!

  • @becomingpure2687
    @becomingpure2687 6 років тому

    Thank u very nice

  • @srilakshmi4384
    @srilakshmi4384 5 років тому

    Wow do more videos in c programming or c ++

  • @lakshmipriya2895
    @lakshmipriya2895 6 років тому

    Super sir u rocking

  • @vattemshekar7826
    @vattemshekar7826 6 років тому +1

    I need help to use the float option in different ways

  • @vivekjayswal81
    @vivekjayswal81 5 років тому

    Sir u guys are best

  • @madicharlakavyatulasi5997
    @madicharlakavyatulasi5997 5 років тому

    I learnt new thing from your video for 1 st one and I want some more about 2nd one why double quotes are not printing.
    Waiting for your valuable reply

    • @maxguichard4337
      @maxguichard4337 4 роки тому

      NESO is a macro that expands to the string "Welcome to Neso Academy!". Remember we can declare a string with something like char *str = "Hello world", in which case the " " do not stay. It is the same here, NESO is only the declaration of the string, and what's in it doesn't include the " ".

    • @marekziba
      @marekziba 4 роки тому +1

      You’d need to escape the quotation marks with \ to have them printed, therefore the string to print should be something like “\”content\”” to have “content” as output.

    • @neerajbaishya781
      @neerajbaishya781 4 роки тому

      @@marekziba Thanks Brother I was looking for this....

  • @mathan3441
    @mathan3441 6 місяців тому

    In q2 what should one do to get the answer as b ?

  • @sharmilas8759
    @sharmilas8759 5 років тому

    Thks ...sir

  • @Lone_Travel
    @Lone_Travel 5 років тому +1

    Neso 😍😍😍❤❤❤❤❤ur amazing guys. Thanks a lot.I hope u upload all gate subjects.

  • @sathybhamafan5015
    @sathybhamafan5015 4 роки тому

    Sir suppose there is no zero,think that value 052 place is replacing with just 52 than the value is 52.if the octal is not it here possible.

  • @Pooh__7__
    @Pooh__7__ 4 роки тому +1

    Even after specifying %o .......... It's throwing an error
    error: invalid digit "9" in octal constant|

    • @SonuGupta-wj6dg
      @SonuGupta-wj6dg 4 роки тому

      Because you might have been using number containing 9 which is outside the scope of octal.
      Try using 56 , 47, it will work . If you use 49 or 48 it won't work and show this error.

    • @charancherry6617
      @charancherry6617 3 роки тому

      Octal number system has Radix 8 that means the distinct digits are 1 to (radix-1) then how will you use 9

  • @Chandankrr
    @Chandankrr 6 років тому +2

    Sir, what I do for hexadecimal??

  • @muthumani7441
    @muthumani7441 5 років тому

    Pls give video for aptitude questn solve

  • @abhishakkhajuria7695
    @abhishakkhajuria7695 3 роки тому

    In the last question s is used for print string so why they not print no. Of string character

  • @hariskumar9010
    @hariskumar9010 5 років тому

    Wow. I knew the answer from thumbnail BTW.

  • @NAINISREEDIVYA
    @NAINISREEDIVYA Рік тому

    how do we know that it is octal only??

  • @santhoshkumarn5188
    @santhoshkumarn5188 5 років тому

    really great plls go ahead like this type of videos

  • @DevanshGandhiJi
    @DevanshGandhiJi 6 років тому

    This is good enough , help me a lot, upload more material as like it.

  • @cherryayethihan
    @cherryayethihan 2 роки тому

    But how can we know the question 1 is based on 8?