Interview Question | C Programming Language

Пікірлер: 896

  • @yashpreetsinghkalsi5380
    @yashpreetsinghkalsi53809 ай бұрын

    same question was asked in my internship interview

  • @Socialmedia......Addiction

    @Socialmedia......Addiction

    9 ай бұрын

    Toh answer kya Diya tha?

  • @rajshiromani727

    @rajshiromani727

    9 ай бұрын

    Tb bhi ans ni pta bhai?? Ans is Hello5😅

  • @TarunSharma-eq3fg

    @TarunSharma-eq3fg

    9 ай бұрын

    @@rajshiromani727 but bhai return 0 ka mtlb to yeh nhi hota ki no. of characters 0 hi print krna (I am new in c language 😅)

  • @gulhusain6015

    @gulhusain6015

    9 ай бұрын

    ​​@@TarunSharma-eq3fgare wo main function ka return type h int main() function hai n isliye return 0 likh rhe Agar void main() likhte to koi value return nhi krani pdti

  • @TarunSharma-eq3fg

    @TarunSharma-eq3fg

    9 ай бұрын

    @@gulhusain6015 oh thanks 😅

  • @shubh_m1
    @shubh_m19 ай бұрын

    Please keep posting videos like this.

  • @Sam_sh02

    @Sam_sh02

    9 ай бұрын

    ​@@nishagwaliya476???

  • @rudragajjar454
    @rudragajjar4549 ай бұрын

    output is: 'Hello 5' since the printf("Hello"); statement will also be executed

  • @rajshaikh3448

    @rajshaikh3448

    9 ай бұрын

    Bhai bilkul sahi bola

  • @sky333suraj

    @sky333suraj

    9 ай бұрын

    The format specifier %d just prints integer.

  • @rudragajjar454

    @rudragajjar454

    9 ай бұрын

    @@sky333suraj yes but the 1st line of code is an assignment statement which are executed from right to left. So the RHS of the assignment which is the command printf("Hello"); is executed first and then it's return value i.e 5 is assigned to variable x

  • @mohammedarifofficial

    @mohammedarifofficial

    8 ай бұрын

    I think "hello 5" is the real answer;

  • @hammer455

    @hammer455

    8 ай бұрын

    No answer is Hello5 no space between them ..

  • @rounakverma8115
    @rounakverma81156 ай бұрын

    This is most common question among all the interviewers, thanku mammm!

  • @thesniperxd5302
    @thesniperxd5302Ай бұрын

    It's nice to see that not only the first printf function prints the hello string but it also returns a value to complete the int x = code which the next printf function prints as 5 ❤

  • @harshahm0130
    @harshahm01309 ай бұрын

    Actually Output is Hello5 because basically printf primarily does its work of printing the text and count the number characters which stores in x

  • @ratnajaiswal169

    @ratnajaiswal169

    9 ай бұрын

    Is there any way to print only number of characters not the original word in printf ??

  • @K15H4N

    @K15H4N

    9 ай бұрын

    ​@@ratnajaiswal169space Instead of word.

  • @iTsRko_

    @iTsRko_

    4 ай бұрын

    Hello 5

  • @kratika83186

    @kratika83186

    18 күн бұрын

    @@ratnajaiswal169 yes indeed , use int x = strlen(“Hello”); and define library function #include

  • @wildyoutuber2615

    @wildyoutuber2615

    15 күн бұрын

    what is x not output

  • @peak_911
    @peak_9119 ай бұрын

    I think this concept of interview qs type videos is very helpful, can you guys make a playlist for interview qs shorts?

  • @mubashiriqbal7656
    @mubashiriqbal76569 ай бұрын

    Keep posting this type of question and also aptitude questions also...🙏

  • @Reactiverahul
    @ReactiverahulАй бұрын

    In python Output Hello None

  • @sanatani-aatma
    @sanatani-aatma6 ай бұрын

    Samjh to nahi aaya but sunke acha laga 😂😂😂

  • @bavyagastya2149

    @bavyagastya2149

    5 ай бұрын

    No. Of character bhai printf function me Hello likha hai there is 5 characters in Hello to screen par output 5 aayega simple

  • @SwingMotor

    @SwingMotor

    4 ай бұрын

    Sanatani ko kab se samaz nhi aa rha ha 😅😅

  • @anuj-13

    @anuj-13

    3 ай бұрын

    😂😊

  • @AlhamdulillahW

    @AlhamdulillahW

    3 ай бұрын

    ​@@SwingMotor 😂😂😂

  • @Shrutiyadav_108

    @Shrutiyadav_108

    2 ай бұрын

    ​@@SwingMotor Jo samjha rahi hai vah bhi sanatani hi hai

  • @anshu2005
    @anshu20059 ай бұрын

    Hey I am here to thank universe . The universe helped me in getting a seat in Delhi University. Four rounds had gone and I was with no seat. So I prayed to universe , trusted him , posted letters to him and finally he helped me. I am so thankful to universe.

  • @ankitmishra697

    @ankitmishra697

    8 ай бұрын

    🙄 Wow bro... ❤

  • @sohamghosh533
    @sohamghosh5339 ай бұрын

    Output is "Hello5" not just 5 as it will also execute printf("Hello")

  • @hitendrachakrawarti5821

    @hitendrachakrawarti5821

    9 ай бұрын

    Yes bro it will excute Hello5

  • @user-zm6nk5mw9i

    @user-zm6nk5mw9i

    9 ай бұрын

    No

  • @nonwestern_outofslavery

    @nonwestern_outofslavery

    9 ай бұрын

    me too

  • @Ankitkumar-pn2lv

    @Ankitkumar-pn2lv

    9 ай бұрын

    Yes hello5

  • @CHAUDHARY_PRAYAS

    @CHAUDHARY_PRAYAS

    9 ай бұрын

    Bhai you are right but she asked what will be printed in place of x not complete o/p

  • @NayanW5
    @NayanW59 ай бұрын

    Wow! Each day you learn something new...

  • @rishabshukla5077
    @rishabshukla50779 ай бұрын

    We need more like this

  • @introvertsenpai9968
    @introvertsenpai99689 ай бұрын

    Thank you ma'am, I thought I was good at C language but this was something new for me 😊

  • @sahilmane8551
    @sahilmane85518 ай бұрын

    Some people are saying that the answer is Hello5 but the question is not that what is the output, but it is that what is x and the value of x is 5, not hello5.

  • @siddheshnarwade3647
    @siddheshnarwade3647Ай бұрын

    As a 12 th std student i m happy to ans the question correctly 😅❤

  • @pavitrakumarsahu2522
    @pavitrakumarsahu25229 ай бұрын

    Didi aapne c language ko bahut achhe se detail se padhaya hai aise aap c plus plus ka padha do n. Hum aap se padhna chahte hai c plus plus. Aapke padhane ka tarika bahut achha hai achhe se samjh me aata hai.

  • @pavitrakumarsahu2522

    @pavitrakumarsahu2522

    9 ай бұрын

    Please c plus plus ka bhi padha do

  • @technoprogramming4753
    @technoprogramming4753Ай бұрын

    5 because printed function returns lengthy of a string

  • @akashsonar6332
    @akashsonar63329 ай бұрын

    These small things make big difference in interview..

  • @sanket7877
    @sanket78779 ай бұрын

    didi pls aisehi minute concepts which student ignore during interviews , aur laiye. It will be very helpful

  • @MaaRiGAMINGOP
    @MaaRiGAMINGOP9 ай бұрын

    First line will give output Hello and assign value to x then second line print 5 combine will be Hello5

  • @mansuralikhanpathan4077
    @mansuralikhanpathan40779 ай бұрын

    This video is very useful to meeru 🥳🥳. I hope to find more questions in it, not only in the C language but also in other programming languages for Interview a🙏🏻🙏🏻.

  • @rohansapate3890
    @rohansapate38909 ай бұрын

    We want more such shorts on C and Java.

  • @user-he7pc4ty1u
    @user-he7pc4ty1uАй бұрын

    Aise hi logic question banate raho mam 😊

  • @sayuri_20
    @sayuri_209 ай бұрын

    Sis, You really motivate me to study every time I see you. I like You already.

  • @Memer09157
    @Memer091576 ай бұрын

    Let me explain that x: 5 and output : Hello5 Because In c, compiler execute first printf function then it return 5, Hello will print on execution. Then 5 will get assign to x, then last printf function print 5. As there is not any space or new line, it will print as Hello5. Printf function return the no. Of char

  • @user-on7mj6bd8p
    @user-on7mj6bd8p4 ай бұрын

    Thank you! I have learned from this video. ❤

  • @purveshmahendrakar2110
    @purveshmahendrakar21109 ай бұрын

    Make a full length video of understanding this type of concepts

  • @zoyasaiyyad6579
    @zoyasaiyyad65799 ай бұрын

    Good question ❤

  • @jayrawat3929
    @jayrawat39299 ай бұрын

    Meaningful❤

  • @kunalmahurkar271il
    @kunalmahurkar271il9 ай бұрын

    Didi @ApnaCollegeOfficial Correct answer is **Hello 5** Because of %d is used length of *hello* also print.

  • @shriyanshu_9k

    @shriyanshu_9k

    9 ай бұрын

    Yss

  • @Hbjbsisbehsbsj

    @Hbjbsisbehsbsj

    2 ай бұрын

    Without space

  • @advaitgadekar6771

    @advaitgadekar6771

    2 ай бұрын

    But int return only integer walue how hello can home?

  • @QuanAffinity

    @QuanAffinity

    20 күн бұрын

    Hello5 not Hello 5 no spaces

  • @suvammagar5287
    @suvammagar5287Ай бұрын

    output is "hello5" but X is equals to 5

  • @rohityadavmudra
    @rohityadavmudra9 ай бұрын

    IT IS HELPFUL, MAJE MORE SUCH VIDEO'S LIKE THIS ✅♥️🙏

  • @TonyStark-zl3ms
    @TonyStark-zl3ms9 ай бұрын

    Thank you mam...keep uploading these types of questions...it enhances our knowledge and help us to clear the interview ❤❤😊

  • @meetparmar2107
    @meetparmar21079 ай бұрын

    Int x=(printf("hello world") , 18); Was asked in iit kgp mid sem exam.

  • @Jayadev-qs4jk

    @Jayadev-qs4jk

    8 ай бұрын

    i guess that comma is of no use there

  • @sebastian18059

    @sebastian18059

    5 ай бұрын

    Same cheez hai, hello world hi print hoga

  • @anurag-bh2ug
    @anurag-bh2ug5 ай бұрын

    We want more videos like this😊

  • @khazeemakanwal7213
    @khazeemakanwal72138 ай бұрын

    We want more this type of questions n this answer Thank u didi

  • @amritanshpandey
    @amritanshpandeyАй бұрын

    Awesome

  • @AryanJC07
    @AryanJC078 ай бұрын

    Yup its simple thanks for sharing ❤

  • @Sattari_01
    @Sattari_012 ай бұрын

    Yr kitni piyri h y...AGR issy hi coding sekhi hoti to aj m programer hota😊

  • @ayushthaware344
    @ayushthaware3449 ай бұрын

    Hello5 is correct Output The Print statement hello will also be printed, talking about next statement, the length of HELLO that is 5 is printed after that without any space

  • @mr.healthbeat5173
    @mr.healthbeat51738 ай бұрын

    I predicted it right in those 3 sec.

  • @fantastic_nisha
    @fantastic_nisha9 ай бұрын

    please more videos like this ❤

  • @learningfiru
    @learningfiru4 ай бұрын

    hey mam ; may the R8 answer will be "hello5"

  • @advaitgadekar6771

    @advaitgadekar6771

    2 ай бұрын

    But int return only integer walue how hello can home?

  • @tgayush1424
    @tgayush14249 ай бұрын

    Bring more videos like this, or make a large video like this , this types of questions come in OA , and the prefix and postfix thing also common...

  • @mrpaulcreations2172
    @mrpaulcreations21729 ай бұрын

    5 , print function returns the length of the printed string

  • @AyoubTahlilHersi
    @AyoubTahlilHersiАй бұрын

    Int is an integer and not a character so only the number 5 will be printed as opposed to being an array of characters [ ] such as hello which is 5 characters. so printf function of hello will be printed and then the number of characters in number "5"

  • @VirenderJi-gs2qs

    @VirenderJi-gs2qs

    Ай бұрын

    Indeed

  • @Rama_Siva
    @Rama_Siva9 ай бұрын

    I run this program/code answer aya - hello5.🤔

  • @Rama_Siva

    @Rama_Siva

    6 ай бұрын

    ​@@vivekdhamande8350 bro character nahi hai eiaha.😂

  • @sarwanray12

    @sarwanray12

    6 ай бұрын

    Ha bhai answer hello5 hi ayega isme x ka value kya print hoga questions ye hai uska answer hai 5

  • @superbikelover01
    @superbikelover019 ай бұрын

    In this question answer is "HELLO 5" BECAUSE value of int x is how many alphabet in Hello and hello is also print

  • @shikharpahade3959

    @shikharpahade3959

    9 ай бұрын

    Data type is int , so only integer value will be printed

  • @kanhagarg1525

    @kanhagarg1525

    9 ай бұрын

    Hello5 without space

  • @DarkMysterioGaming

    @DarkMysterioGaming

    9 ай бұрын

    ​@@shikharpahade3959no bro

  • @superbikelover01

    @superbikelover01

    9 ай бұрын

    @@kanhagarg1525 yes but I mention in this comments for understanding "HELLO5" THIS IS REAL OUTPUT

  • @shriyanshu_9k

    @shriyanshu_9k

    9 ай бұрын

    ​@@shikharpahade3959bhai practical krke check krle....hello5 print ho rha h

  • @hamzahashmiofficial
    @hamzahashmiofficial9 ай бұрын

    Intelligent

  • @AkashSupkar-io9up
    @AkashSupkar-io9upАй бұрын

    'X'usiko kahata ha jo hame chor ka chali jati ha 😢😅

  • @sagaryadu976
    @sagaryadu9769 ай бұрын

    Also it is return blank space and integer value ..

  • @ramjiyadav5147
    @ramjiyadav51474 ай бұрын

    Outstanding shradhha ji

  • @lokeshhemane2153
    @lokeshhemane21539 ай бұрын

    great pls post like this videos..

  • @divine3832
    @divine38329 ай бұрын

    Those who are saying it prints Hello5, try running only int x= printf("Hello"); It will give 'Hello' as output, and if you write the complete code, it will print 'Hello5', meaning, 5 is the answer that x is returning

  • @OFCnaman

    @OFCnaman

    9 ай бұрын

    Is shows error , bro int x sirf integer leta hai to int x ko ham print hello ko kaise print kr skte

  • @president-0-0-7
    @president-0-0-75 ай бұрын

    awesome 👍

  • @muhammad_saad_007
    @muhammad_saad_0072 күн бұрын

    Hello5 not just 5 because we are printing the string too

  • @killxsad
    @killxsad9 ай бұрын

    for the people in the comments saying it will print hello5, the question in the video is: "what is x?", which mean what comes in place of x and the answer is '5'. The complete output will be 'Hello5'.

  • @SidsAnalysis
    @SidsAnalysis6 ай бұрын

    Jo printable cheeje hongi unka count number print hoga Jaise isme Hello ye sare printable hain Isiliye iska answer 5 aayega However isme \0 null character bhi hai but vo printable nhi hai isiliye vo is count me nhi add hoga

  • @Aarya_x12
    @Aarya_x129 ай бұрын

    OUTPUT (Hello5) aa rha h

  • @ankitkumar-qi3cd

    @ankitkumar-qi3cd

    4 ай бұрын

    correct bro, qki phle first wala printf apna Hello print krega, phir baad me next wala printf X ki value print krega :-) then output aayega Hello5

  • @AslamNazeerShaikh
    @AslamNazeerShaikhАй бұрын

    Its programming language specific question.. they questions are good for freshers and not for experienced developers.. 😂 these days people are asking inbuilt function's functionalities outcome

  • @princepexz
    @princepexz9 ай бұрын

    Intresting

  • @garimadixit4634
    @garimadixit46349 ай бұрын

    Best question 🎉🎉

  • @kishoraryal663
    @kishoraryal6632 ай бұрын

    Impressed

  • @jarvis9263
    @jarvis92635 ай бұрын

    #include int main() { // Write C code here int x = printf("Hello "); printf("%d ",x); return 0; } output ---> Hello 6

  • @Abhishek-qw2mf
    @Abhishek-qw2mf9 ай бұрын

    Phli bar koi sahi jawab mene dia hai apka 😂❤

  • @TIMEZEDFF
    @TIMEZEDFF9 ай бұрын

    My future dream world Best hacker banung ❤❤❤😊😊

  • @VishalSingh-nn4ne
    @VishalSingh-nn4ne6 ай бұрын

    %d indicates the integer value thats why 5 will be print

  • @onetofun
    @onetofun9 ай бұрын

    We want more like this...😇✨

  • @Lets_coding18
    @Lets_coding184 ай бұрын

    THanks didiiii😍✨

  • @madhukantsingh_MSI_GROUP
    @madhukantsingh_MSI_GROUP5 ай бұрын

    Nice voice....😊😊

  • @ShauryaThareja
    @ShauryaThareja9 ай бұрын

    bht bdia pdate ho aap

  • @k28999
    @k289999 ай бұрын

    keep posting such videos ma'am

  • @PokeBoy-pe8lr
    @PokeBoy-pe8lr4 ай бұрын

    I am a beginner. If c++ is an extended of c ,then why we use “printf” and “cout” to output a statement.

  • @zimon7182
    @zimon71826 ай бұрын

    Thank you didi❤❤❤

  • @suvammagar5287
    @suvammagar5287Ай бұрын

    if we do scanf then it gives the output "hello"

  • @komalkhatod1042
    @komalkhatod10429 ай бұрын

    Very nice question ❓😊😊😊

  • @mukherjee.p
    @mukherjee.p24 күн бұрын

    There's nothing to "think" about this. If you know you know lol. You may not be able to just guess the return value out of a random function (random because you typically wouldn't use it like this) right. Typically in systems languages, they usually return the "number of bytes written" from printing or writing functions. So there's that.

  • @CaptainCoder1
    @CaptainCoder19 ай бұрын

    Quite simple problem for those who atleast knows the function signature of printf function it return an integer which is equal to number of characters that it has successfully printed in the console screen.

  • @ratnajaiswal169
    @ratnajaiswal1699 ай бұрын

    It prints Hello5... Is there any way to print only number of characters not the original word in printf ??

  • @user-yy7uw1qx9h
    @user-yy7uw1qx9h8 ай бұрын

    X is an variable and it's stored the statement that are *hellow world*.

  • @MdRakibulhasan-dq5dh
    @MdRakibulhasan-dq5dh8 ай бұрын

    yes the x value is 5 .if we get this code output .than we have hello5 output

  • @Anemptysoul
    @Anemptysoul6 ай бұрын

    The answer is not only 5 . It's hello5 as printf("hello"); statement will also execute.

  • @ujjwalchowdhury2551
    @ujjwalchowdhury25518 ай бұрын

    Great 👍 great 👏

  • @StaticTechnology
    @StaticTechnology5 ай бұрын

    This is not logic test. This is how much memory you have in your mind.

  • @zimon7182
    @zimon71826 ай бұрын

    Thank you didi

  • @pritigulhane3542
    @pritigulhane35425 ай бұрын

    Thank you👍😊

  • @bhavinpancholi3488
    @bhavinpancholi34889 ай бұрын

    good . impressive

  • @gaming9876king
    @gaming9876king9 ай бұрын

    Thank you

  • @sahilchopde1450
    @sahilchopde14509 ай бұрын

    Answer is " Hello5" not only 5 I also run the program

  • @Tbm4545

    @Tbm4545

    9 ай бұрын

    Bete usne x ka value pucha hai na ki kya print hoga, Wo jo hello print horaha hao wo uper wali print statement ka ans hai aur uske bad x yani ki 5 print horaha hai, aur udhr new line statement nahi use ki hai isliye wo hello5 ek sath print hoarah hai

  • @luxrayy2041

    @luxrayy2041

    7 ай бұрын

    ​@@Tbm4545yeahhhh

  • @Hbjbsisbehsbsj

    @Hbjbsisbehsbsj

    2 ай бұрын

    ​@@Tbm4545 oh

  • @mohammadabdullahaalforhad1375
    @mohammadabdullahaalforhad13755 ай бұрын

    impressive

  • @user-dh6gd1wv2t
    @user-dh6gd1wv2t9 ай бұрын

    Thank you very much

  • @Motivationc125
    @Motivationc1257 ай бұрын

    Yes my thinking is right

  • @shubhangiagarkar1708
    @shubhangiagarkar17083 ай бұрын

    Certainly! Here's the corrected code that stores the value returned by `printf` in `x` and returns it: ```c #include int main() { int x = printf("hello"); printf("%d", x); return x; } ``` This code prints the length of the string "hello" followed by its actual length, and then returns the value of `x`. So the output will be: ``` hello5 ``` And the return value of the program will be `5`.

  • @pkavenger9990
    @pkavenger99909 ай бұрын

    I am python programmer and i have never touched C but as i see int and then i saw d% and gussed that answer will be in digits atleast instead of string.

  • @motivationallifevideos1
    @motivationallifevideos17 ай бұрын

    😂humne pahle video dekha to socha add hai😅😅😅

  • @shaikhIsmail-hp9ci
    @shaikhIsmail-hp9ci3 ай бұрын

    Thank you madam

  • @sagardas9060
    @sagardas9060Ай бұрын

    I had my college placement today. They asked this question in the coding exam .

  • @pintugujjar1334
    @pintugujjar13349 ай бұрын

    Me being a civil engineering student trying to understand the question with the help of answer😅