I want to thank you sir, Your tutorials are helping me with my studies. Earlier I didn't know What is C. but when it came to my syllabus then I started watching your tutorials. It really helped me to understand than compared to other tutorials... Now I am on 15th chapter and I know, When I will reach to 139th. It will be a big blow to me... Thank you, Sir...
@nangng98559 жыл бұрын
Thank you, this'll help me a lot in my classes. Maybe you could have subtitles..for people like me who has hearing problems..
@LearningLad9 жыл бұрын
no hEal yup! Some of our initial video's have very low volume level. We will try to add subtitles AEAP. Thank you :)
@jeffersoncobbina29894 жыл бұрын
I'm proud to get you bro👍
@pinklady71847 жыл бұрын
Many thanks for your tutorials.
@developerstimes7394 жыл бұрын
Good Mr. Anil
@LearningLad4 жыл бұрын
Thank you :)
@ravi76199 жыл бұрын
Dear Anil, Your videos are very helpful to beginners and non-techies :) I have 2 questions based on this lesson: 1/ when i mention weight as 60.3, the output displayed is 60.299999 - why is this so? 2/ why can't we use 'male' instead of 'm'. Thank you
@ravi76199 жыл бұрын
+LearningLad
@LearningLad9 жыл бұрын
+Ravi Iyer can u pls provide the source codeso that i can check for 60.2999999 as for as your 2nd question is considered, In a character variable, we can store one character. 'm' is a single character, so we can store it in a character variable. "male"' contains more than one characters and it is considered as a string. so we need to use character arrays to store them and you will learn about them later in this video series.
@ravi76199 жыл бұрын
+LearningLad Thank you. Here's my code (I face this issue with all decimal nos.) #include #include int main() { int age; float weight; char sex; age=28; weight=32.8; sex='M'; printf("%d %f %c", age, weight, sex); getch(); return 0; }
@amitgradient110 жыл бұрын
Nice Video Anil. Can you share a video about installing C compiler for iOS or share any link, if you know of one.. Thanks
@jayasree26696 жыл бұрын
sir instead of int main...can we use void main...if at all we can use what is the difference between them
@amritkumarbehera96316 жыл бұрын
Thank you very much
@LearningLad6 жыл бұрын
my pleasure :)
@priyagupta50818 жыл бұрын
if there Isn't anything to return, can we use void main() here?? plz reply
@sunilpatil81448 жыл бұрын
yes you can :)
@anandpathik9 жыл бұрын
Hello friend, I am quite new. And I am enjoying learning through your lessons. I am having a problem, I wrote all the programming seeing your video but when I run the program age, weight, sex is 0, 0.0000, and a symbol. help me plz
@Deathvveeps9 жыл бұрын
Vikas Kumar I too, followed this to the letter, read over it and yet again I get a random number for my age with up to seven numbers, 0.0000 for my weight, and my sex is an odd symbol...but the screen displaying the words "age,weight,sex" appear just fine. Any reason as to why?
@Deathvveeps9 жыл бұрын
Vikas Kumar Okay so this should work, we forgot to call the variables, you probably have something like this: printf (" %d %f %c, age, weight, sex"); WRONG printf (" %d %f %c, age, weight,sex", age, weight, sex); RIGHT ^^^^^right above, calling the variables age, weight, sex. I'm new to this as well, but that is all I could come up with...I think this is right.
you may have used - instead of = while assigning value
@telugumemeworld44767 жыл бұрын
when i compiled and run the programme the out put is showing "hello learner" which we did in the first programme i did this programme exactly as u said but only the output is differing plzz help
@sreekumark88777 жыл бұрын
great video sir.how much hour should I spend for studying programming,
@LearningLad7 жыл бұрын
dont calculate timings. if you are interested then just start learning.
@koishikisskogasa3 жыл бұрын
I have been 3 days of learning basic now imma make web from c
@UNKNOWNKINGTHEGAMER7 жыл бұрын
when I compile it and run it says Error Id returned 1 exit status Now, what should I do?
@harshavardhanupputuri62117 жыл бұрын
Sir pls can u explain the diff between studio.h nd conio.h can't studio.h provides the functions to pause the program
@tejaswinireddy29429 жыл бұрын
hello sir i am new to this c programing i am geting you of what u said but the one i am not understanding is how ur leaving the numbers n keeping the brackets how can it done? means how will we know to put like that the brackets
@LearningLad9 жыл бұрын
Tejaswini Reddy i'm sorry. i'm not getting your question. can you post more info???
@jobforj9 жыл бұрын
+Tejaswini Reddy flower bracket? press shift and anf then press that key on the keyboard
@minicraftyclub42583 жыл бұрын
If variable name is “Dan” than we will use char ??
@LearningLad3 жыл бұрын
It's not about the variable name It's about the type of data we are storing
@gandamalamounika84769 жыл бұрын
hello anil as u said that integers are numbers ryt then whats the diffence between age and weight as both are pepresented in numbers how come weight is floating point????
@saiphanindra47119 жыл бұрын
***** weight can be in decimals like 10.5, 50.7...but age is only numbers like 21, 34...so floating is for weight and int is for age..:)
@VashishtArora10 жыл бұрын
Anil, please answer yogananda's question. Having the same doubt
@LearningLad10 жыл бұрын
blondekane hi i think i have answered his question. if not pls let me know what doubt u have.
@silver_ingame28110 жыл бұрын
Awesome video, would like to ask you a question, why is there a need to use %d,c and f? Wht is the purpose of this? Thanks
@silver_ingame28110 жыл бұрын
I tried to use %i for the age as it is an integer and it works too. Why do we need to use % in order to print out.
@LearningLad10 жыл бұрын
hi Silver_InGame %d, %f, %c etc are called format specifiers. They are like placeholders for some values and they start with the % symbol. consider printf("age is 25"); it will display only the age is 25 to the screen all the time. but if we use printf("age is %d",age); In this case %d acts like a placeholder for an integer value. Here "age is %d" acts as a template and we can use it to display different values stored in the age variable. So by using these format specifiers, we can create a template that can be used for different set of values. % is the least used symbol so thats why they used it to specify format specifiers i guess!
@kumariashutosh91429 жыл бұрын
good evening sir, i am very weak in coding but i want to learn .and i am doing B.tech from computer science branch so it is very important for me to have proper knowledge and concept of c.so please suggest me some ideas so that i can improve my self and can do better from the other students in my class.
@saikiran-cb7jd8 жыл бұрын
why are we using , int main() and printing "hello world" main doubt what is returning the value.
@FitnessChaos5 жыл бұрын
good video
@LearningLad5 жыл бұрын
Thank you :)
@uraaxeecaqligaaga48905 жыл бұрын
Thank you sir but please explain why you have not written scanf( ).
@CG-yw3eq3 жыл бұрын
What editor are you using in the tutorial?
@LearningLad3 жыл бұрын
dev cpp
@ajaykalapad15417 жыл бұрын
Sir, in row number15 why there is written about weight and sec but not about age?
@chinmaymhatre2778 жыл бұрын
Can we use %i insted of %d ?
@ankithprabhu45529 жыл бұрын
anil bhaiya, this time i tried combining ur present n previous videos...but i get the output in a single line...how can i print 2 things in seperate lines waiting fr the answer u rock B)
@ankithprabhu45529 жыл бұрын
i saw ur next video....sry....learning this fr the first time #prettyexcited
@p.naveenkumar15667 жыл бұрын
why we are using return 0 i cant understand will u please explain me...
@LearningLad7 жыл бұрын
to explain in simpler terms, when you run your program, operating system calls your program for execution, it starts with the main function of your program. main function is the starting point of the program. when we have int main it means that the main function while finishing the execution will return an integer value. this value will indicate whether program has successfully finished or encountered some error. return value of 0 means program has finished without any error. any other value will indicate a specific error. So we are using return 0; to indicate the operating system that our program has finished execution successfully.
@jainam_zobaliya6 жыл бұрын
@@LearningLad Instead of returning 0 I have tried different no.s but Instead of that no. It's returning a random no. Why this is happening?
@vedikagarg91279 жыл бұрын
which compiler should i use ?
@LearningLad9 жыл бұрын
+Vedika Garg use the gcc compiler. You can download and install the codeblocks ide with the mingw (Minimalist GNU for Windows). checkout kzbin.info/www/bejne/g3Wtaqh7fambnLc (this tutorial is in the c++ playlist. But you can use this for c also) Hope this helps ;)
@eggsybee90108 жыл бұрын
sir... what is return 0;? and when do we use that?
@rameshkumarallam84768 жыл бұрын
hi sir its showing(error) expected `;' before "getch"
@mohammedibrahim95088 жыл бұрын
hi sir, my program is compiled but when i try to run it, its asking me "source file not compiled" can you help me out?
@LearningLad8 жыл бұрын
Thats because the dev cpp (from bloodshed) u have installed has some issues in windows 8 or later versions. First uninstall it and then download and install orwell dev cpp. it will work properly.
@mohammedibrahim95088 жыл бұрын
thank you so much i really appreciate it.
@dencygomes97508 жыл бұрын
good morning sir..i tried this program and it got compiled correctly..but i have 1 doubt..i added char name and then after declaring i wrote it as name = 'Dency' and gender also i wrote it as gender= 'Male' but den in my output i got only one alphabet from my name ie. y (from the name)and e(from the gender) i want full name sir..how to print it?
@paulolando67826 жыл бұрын
hello sr Can you please clearly specify what type of software are you using to conde C languange
@sgt.boris47134 жыл бұрын
Dev C
@kumarmihiir76389 жыл бұрын
source file is not getting compiled a dialogue for g++ exe no t responding pops out and .. while running it says the file hasn't been compiled
@LearningLad9 жыл бұрын
+Kumar Mihiir The problem is with the dev cpp ide. i Suggest you to use orwell dev cpp. Just google it and you will get the download link. or use codeblocks ide with mingw. checkout kzbin.info/www/bejne/g3Wtaqh7fambnLc hope this helps :)
@vickypandey52687 жыл бұрын
hello i am getting an error when i tried to declare "school" as like char school it prompt as character constant must be one or two characters long what should i do
@LearningLad7 жыл бұрын
just give your sample code pls
@devarapallisrilakshmi84454 жыл бұрын
Yes char is for single characters only declare it by using strings
@sharathkumar665110 жыл бұрын
i am getting the error as "SOURCE FILE NOT COMPILED" after compilation and running the program.PLZZZ GIVE ME REPLAY....
@LearningLad10 жыл бұрын
sharath kumar i think you are using windows 8 os and dev c++ compiler set. in windows 8 dev c++ has some issues so i suggest you to download and install codeblocks ide along with mingw compiler set. checkout this tutorial which explains how to download and install codeblocks. kzbin.info/www/bejne/g3Wtaqh7fambnLc Hope this helps :)
@kumarraja57619 жыл бұрын
hello sir your teaching is good
@LearningLad9 жыл бұрын
kumar raja thanks man :)
@bhanukat710 жыл бұрын
Hello man thanks for the video tutorials. but i didn't getting the output menu in dev C++ can you help me for that..????
@LearningLad10 жыл бұрын
Hi Bhanu Prakash , if you are using windows 8 OS then Dev C++ won't work. Developers are not updating Dev C++ from a long time. So you can use Other IDE's like CodeBlocks, Eclipse etc. I have already made a tutorial on how to download and install CodeBlocks. Search for it in my channel. Thank you :)
@hirendarji949110 жыл бұрын
guys those who are getting the "SOURCE FILE NOT COMPILED" in DEv C++ please download this overall version of dev C++ from here sourceforge.net/projects/orwelldevcpp/files/latest/download?source=files ..then you will be able to run your file surely.
@sreelakshmirsyam7639 жыл бұрын
sir, i have followed all your instructions but when i tried to compile, a message appeared telling that" printf undeclared (first use this function)" what should i do??
@LearningLad9 жыл бұрын
Sreelakshmi R Syam may be you have done some typo. check for that. if still the problem persists, then post the source code here so that i can help :)
@sreelakshmirsyam7639 жыл бұрын
*****thank u for ur reply :) .. checked for typos but couldnt find any.can i send what i have done as screenshot to your facebook page??(dont know how to post the source code here)
@LearningLad9 жыл бұрын
Sreelakshmi R Syam ok :)
@tejkiranyabaku4357 жыл бұрын
when i change my data input to get different output i cant build and run the program as the option is blocked .how to solve this please help me
@LearningLad7 жыл бұрын
i think you are not closing the previous build (that cmd window) close it and you will get the options to run the program
@tejkiranyabaku4357 жыл бұрын
thank you ...!!! now i got it
@smilygupta48799 жыл бұрын
sir why u r use int main And we can't use void main here
@anjalisinha78017 жыл бұрын
hello sir i am not able to run the program.after compilation a warning occurs as "source file not compiled".please help me
@LearningLad7 жыл бұрын
that's because you are using bloodshed dev cpp in windows 8 or later version of os. this software is not be maintained now. uninstall it. download and install orwell dev cpp (simple google search will give you the download link) it will work :)
@indhujag59204 жыл бұрын
@@LearningLad bro it is not working even for codeblocks.What can I do? Please help
@powertran67558 жыл бұрын
LearningLad can you fix this please When trying to compile we get a message: Warning! source file not compiled!!! thx
@AntarikshPratham8 жыл бұрын
+powertran are you using an ide for coding? you have to systematically first build and then compile the program...
@divyapandu62779 жыл бұрын
i installed software as u instructed but i am getting an error in run i am getting source file in not executed
@LearningLad9 жыл бұрын
Divya pandu hi, i think you are using windows 8 or later version of os, where dev cpp has some issues. So i suggest using codeblocks ide. (i have put an annotation about this in the video. i guess you have disabled annotations) checkout kzbin.info/www/bejne/g3Wtaqh7fambnLc Hope this helps :)
@MrRishabh048 жыл бұрын
thnx bro
@LearningLad8 жыл бұрын
welcome :)
@boldowl69265 жыл бұрын
Please reply fast #include #include int main() { int age; float weight; char name; age = 17; weight = 55.8; name = 'Anish'; printf("%d %f %c",age,weight,name); getch(); return 0; } here i want to print name as anish but it says character constant too long for its type , what should i do if i want to print words instead of a single letter.
@LearningLad5 жыл бұрын
name is of type char so it can contain only one character. Anish is a string which contains more than one character. So you are getting the error. name = 'A' will work or you
@Christine-ne3dw5 жыл бұрын
You should use " " since it's a group of char then use %s to display it
@Christine-ne3dw5 жыл бұрын
. . . name = "anish"; printf("%s", name); . . .
@shreyashrivastava92089 жыл бұрын
hello sir,my program gets compiled easily but when i run it, it show "Source file not compiled" What should i do?
@LearningLad9 жыл бұрын
+Shreya Shrivastava download and install orwell dev cpp or codeblocks ide along with mingw compiler set.
@navaneethkrishna38857 жыл бұрын
sir do this work in turbo c++
@LearningLad7 жыл бұрын
yes. it will work
@tapasvipannaty28499 жыл бұрын
hello sir this is my program #include #include int main() { int age; float weight; char sex; age= 32; weight= 52.5; sex= 'f'; printf("%d %f %c" ,age,weight,sex); getch (); return 0; } i am using code blocks. when i tap on build operation.It is unable to build, it is showing some message here it is Message Build: debug in main error : Aborted (program collect 2) build failed please help me sir.
@tapasvipannaty28499 жыл бұрын
+Tapasvi Sri and program has compiled successfully.
@lissettevelec59555 жыл бұрын
How declare char variables fritsch and temp ch; ?
@avneeshmanian23879 жыл бұрын
when i compile and run my file .... it says source file not compiled... what should i do?
@LearningLad9 жыл бұрын
+Avneesh Manian i think you are using windows 8 or later version of os and dev cpp has issues. ( i have informed about this in the video using annotation and also in description. You may have missed it) So i say you download and install codeblocks ide along with mingw compiler set. i have a video explains about it checkout kzbin.info/www/bejne/g3Wtaqh7fambnLc hope this helps :)
@percycebo509 жыл бұрын
It says this when I try to compile it 17 5 C:\Users\user\Documents\4.c [Error] expected ';' before 'getch'
@LearningLad9 жыл бұрын
+Percy Cebo you missed a semicolon just before (previous line) the getch(); statement
@amitha.h.58047 жыл бұрын
hi i am getting run time error and if it works the output is not correct plzzz help me
@MANOJKUMAR-rw9zw7 жыл бұрын
i installed dev cpp.. and i have written a program. program got copiled but its not running
@anwaralam31366 жыл бұрын
in this video all the output are printed in a same line what should i do if i want print the 3 output line by line 1)output 2)output 3)output like this....?
@chittireddy42444 жыл бұрын
Use "/n:
@superb69939 жыл бұрын
Thank u sir,for ur video .This helped me a lot.But every time i compile the program i get indication from my antivirus that VIRUS detected .??????????????
@aadityaaumale02068 жыл бұрын
Why you didn't use clrscr() after variable declaration..??
@kartick12418 жыл бұрын
Modern c/c++ ide open a new output window everytime we run the program so there is no previous output showing so we can avoid using clrscr() [now system("cls"); ] until required.
@leochoi31815 жыл бұрын
not sure if im doing this right but i get this message Checking for existence: C:\Users\82108\Desktop\program\trial1.exe what does it mean??
@kirantomar10727 жыл бұрын
sir age weight sex sare new line mai kese print hore h new line k liye to lgana hota h na
@suryarotte84799 жыл бұрын
when i compile this program, I get output as 0, 0.000, 0 please help what does that mean?
@LearningLad9 жыл бұрын
+Surya Rotte may be you are not initializing the variables. pls post the source code here or send a screen shot on our facebook page.
@suryarotte84799 жыл бұрын
+LearningLad okay sir
@suryarotte84799 жыл бұрын
+Surya Rotte #include #include int main() { // datatype name; int age; float weight; float height; char sex; age = 23; weight = 50.2; height = 6.2; sex = 'M'; printf("%age %f %f %c age,weight,height,sex"); getch(); return 0;
@LearningLad9 жыл бұрын
Surya Rotte you got the printf function wrong. it should be printf("%d %f %f %c",age,weight,height,sex); hope this helps :)
@shilamandal68377 жыл бұрын
my program is not compile pls tell me.. how to save my program and run
@LearningLad7 жыл бұрын
what error you are getting??? also checkout the comment section of this video. you may get the solution for your problem :)
@zybotsu0018 жыл бұрын
why a capital 'M' for char, shouldn't it be 'm'? Wouldn't that report an error?
@sunilpatil81448 жыл бұрын
NO...you have declaired variable "sex" which is of "character" type and in "sex" variable you have stored capital "M"...It won't give any error :)
@sunilpatil81448 жыл бұрын
You can store anything in "sex" variable as long as it it of "character" type :)
@UnknownPerson-eu3vm8 жыл бұрын
what's difference between %d and %i ?
@TheNiccopark9 жыл бұрын
hey ...great video but why have you used "%d %f %s" ........what do they mean???
@LearningLad9 жыл бұрын
andrew %d %f %s are called as format specifiers. we use %d for integers %f for float %s for strings etc.
@TheNiccopark9 жыл бұрын
thanks
@sandeshsubedi29229 жыл бұрын
Why is %d used for age ?
@LearningLad9 жыл бұрын
+Sandesh Subedi age is of type int. so we use %d format specifier.
@amitghosh39386 жыл бұрын
Hey, this is not working in turbo c
@thanoszaxarias97149 жыл бұрын
printf("%d %f %c",age,weight,sex); it finds fault on it and it doesnt run why?
@LearningLad9 жыл бұрын
+Thanos Zaxarias send the complete source code pls...
@thanoszaxarias97149 жыл бұрын
i wrote it again and i was missing a (;) and dint close the main }.I am sorry -.-
@thanoszaxarias97149 жыл бұрын
i want to ask something new sir, can u please explain me the usage of #include.I use it but i dont know why i use it thanks ;D
@johnyvicewax737510 жыл бұрын
Hello Sir, In assigning sex; gender, how to assign sex=MALE instead of 'M'?
@LearningLad10 жыл бұрын
Yogananda Kh you have to use a character array to store string values. which i have explained in a specific tutorial. checkout kzbin.info/www/bejne/aKi9enifn5aYes0 Hope this helps :)
@johnyvicewax737510 жыл бұрын
***** thank you sir, i will learn in order of your lessons.
@pallerlanandakishore72518 жыл бұрын
In char i entered my name and it is showing a warning that character constant is too long. why?
@ummulhuda12788 жыл бұрын
A character can be only single digit
@shravyareddy41948 жыл бұрын
hi sir, im getting y at sex as output im not getting f 'f';
@adhishaggarwal52328 жыл бұрын
hi sir, its showing [Error] expected ',' before 'sex'
@LearningLad8 жыл бұрын
pls provide source code. you might have missed a semicolon.
@_kale_43377 жыл бұрын
#include #include int main() { //datatype name; int age; float weight; char sex; age = 23; weight = 50.5; sex = 'M'; printf("%d %f %c",age,weight,sex); getch(); return 0; } but still the output is not the same. only " #d #f #c ". what to do.
@rameshdevasi2176 жыл бұрын
please help me: tell me why %d is for data??????????????? :(
@mohammedanwarfaizi28508 жыл бұрын
WHY ARE USING int main () WHERE main() IS ENOUGH? CAN YOU PLEASE ANSWER?
@saikiran-cb7jd8 жыл бұрын
yup! mr.mohammed anwar point to be noted is that, main() is the function type ,,, and int is the data typewith out mentioning the data, type for main function, then how does the computer understand, to take the valueslike---int values, char values, flote values
@saikiran-cb7jd8 жыл бұрын
hope! you understant
@Icyhandss Жыл бұрын
Hello! I know this video tutorial is 10 years ago, I am a freshman student taking BS Computer Science, I want to ask whats wrong with my code, I am trying to output a name and date of birth using printf input name and scanf char name; printf("insert name: "); scanf("%c", &name); int birthday; printf("input date: "); scanf("%d", &birthday); printf("My name is %c and my birthday is %d", name, birthday); I hope you notice thank you so much
@LearningLad Жыл бұрын
char data type can hold only one character. you cant enter your name for that
@Icyhandss Жыл бұрын
@@LearningLad Hi! Its me again, I hope you’ll notice me again, I am struggling to grasp the C language but cant afford to fail. If its not too much, Whats wrong with my code? int age; printf("Enter Age "); scanf("%d", &age); char sex; printf("Enter M or F "); scanf("%c", &sex); if (age > 17 ) { switch (sex) { case 'm': printf("adult male"); break; case 'f': printf("Adult Female"); break; } } else if (age < 18) { switch (sex) { case 'm': printf("Male Minor"); break; case 'f': printf("Female Minor"); break; } } I am receiving dash: 2 m: not found I tried other online compiler the result is Program finished with exit code 0 Thank you for your help. 🥹🥹🥹
@prathameshchavan28129 жыл бұрын
Why a character is written in a single quote?
@sunderaatma93798 жыл бұрын
i ve saved and compiled this program of age,weight,sex but when i run it,it is not showing the data. It is showing 0 0.000000 a ,age,weight,sex. PLZ TELL THE SOLUTION?
@LearningLad8 жыл бұрын
pls send a message to our facebook page along with your source code.
@rajanagenderreddy39297 жыл бұрын
#include #include int main() { int age; float weight; char sex; age = 25; weight = 90.5; sex = "M"; printf("%d %f %c",age,weight,sex); getch(); return 0; } but in output "M" charecter is not coming
@anujasonavane7 жыл бұрын
#include #include int main() { //data type name; int age; float weight; char sex; age = 17; weight = 40; sex = 'F'; printf("%d %f %c",age,weight,sex) getch(); return 0; } 16 D:\Desktop\c++\second.c syntax error before "getch" what should i do? whats wrong with it?
Hi Anil when I am executing the same program it is showing some error in the place float could you please help me... #include #include int main() { float weight; float = 51.5; printf("%f",float); getch(); return 0; } it is showing some error like "syntax error before float"
@LearningLad7 жыл бұрын
float is the datatype. you need to assign value to the variable weight. so replace float = 51.5; with weight = 51.5;
@ankithprabhu45529 жыл бұрын
hi anil bhaiya can u pls tell me how can i make it print the results as age 23 weight 50.500000 sex M ????? pls reply soon great job B)
@ankithprabhu45529 жыл бұрын
got it..hehe
@kardsrohitjagtap22858 жыл бұрын
hey..if i want to show sex = m than how shall be program
@arctic_corner9 жыл бұрын
can i write char sex; sex = 'Male'; ?
@LearningLad9 жыл бұрын
Sophia Man no you can't. Because here in your example, sex is a character variable so you can store only one character in it. When we have more than one character, we need to use a character array which you will learn later in this series :)
@arctic_corner9 жыл бұрын
thanks ! you answer every question that's very nice of you !
@gergelyfekete59178 жыл бұрын
who know create snowflake in language c?
@davidb88319 жыл бұрын
A few things I didn't understand because you spoke too fast.. you should make a group on google hangouts!
@thanoszaxarias97149 жыл бұрын
+David B thats why there is the pause button on youtube
@somnathbhattacharya16987 жыл бұрын
sir cant see clearly....make page clear
@DeyvesshKumar9 жыл бұрын
#include #include int main() { int age; float weight; char sex; printf("Enter your age, weight, sex "); scanf("%d%f%s",&age,&weight,&sex); printf("Your age is %d Your weight is %f Your sex is %s",age,weight,sex); getch(); return 0; } IS MY PROGRAM CORRECT? BECAUSE THE RUN COMMAND DOES NOT LETTING ME TO ENTER THE VALUE OF CHARACTER 'SEX'.
@LearningLad9 жыл бұрын
Deyvessh Kumar since sex is a character variable, use %c format specifier. But after changing that also you will not be able to read value for sex. That's because after entering value for weight, you hit enter button or a space to separate input and that input separation will be read for sex. So it won't give you an option to enter value for sex or will not read proper value for sex. So here is a quick fix which will let you run your program. Use a space after reading weight. i.e scanf("%d%f %c",&age,&weight,&sex); This space we added will be matched for the enter or the space you add after entering weight, and then you can read the value for sex. here is the working code. #include #include int main() { int age; float weight; char sex; printf("Enter your age, weight, sex "); scanf("%d%f %c",&age,&weight,&sex); printf("Your age is %d Your weight is %f Your sex is %c ",age,weight,sex); getch(); return 0; } Hope this helps :)
@aadarshasubedi1239 жыл бұрын
hello devessh Kumar if you write %c then output should be "m" or "f" but if you write "male" or "female" then there should be %s. since "%c" is for one character whereas "%s" is for string.
@aadarshasubedi1239 жыл бұрын
+aadarsha subedi you should verify male or female in main function. .
@avneeshmanian23879 жыл бұрын
i am having difficulty compiling it
@JonathanDean959 жыл бұрын
+Avneesh Manian which compiler are you using ?
@vikikaushik93189 жыл бұрын
vickeyvk93
@ರಾಮಾಚಾರಿ-ಸ5ವ6 жыл бұрын
Ur age is not 23
@smilygupta48799 жыл бұрын
sir why u r use int main And we can't use void main here