C Programming Tutorial - 11 - Getting Input with scanf
About | Information | History | Online | Facts | Discovery
Facebook - https://www.facebook.com/TheNewBoston-464114846956315/ GitHub - https://github.com/buckyroberts Google+ - https://plus.google.com/+BuckyRoberts LinkedIn - https://www.linkedin.com/in/buckyroberts reddit - https://www.reddit.com/r/thenewboston/ Support - https://www.patreon.com/thenewboston thenewboston - https://thenewboston.com/ Twitter - https://twitter.com/bucky_roberts
Comments
-
printf("bucky is awesome");
-
can anyone send a link to downloas sscanf.so file??
-
Buffer overflow... Use char *firstName; instead of char firstName[20].
-
plz tell me how to print lines?plzzzz
-
What data type I must use if I want to use both integer and words in my input? And how to write that in code?
-
Nice job body...
-
instead of babies I put how many video games he will buy me. so humble.
-
3:01, how did you replace the array with one click?
-
What is problem here...it compiles and run successfuly till it takes input ,but when its time to get final outpur my PROGRAM STOPPED WORKING!!!
#include <stdio.h>
#include <stdlib.h>
int main()
{
char collegename[25];
char myname[20];
char branch[25];
int yearofadmission;
int yearofpass = (yearofadmission+4);
printf("Hello , Tell me your name?\n");
scanf("%s", myname);
printf("Which college you go for engineering?\n");
scanf("%s", collegename);
printf("That's fine, so which branch you have chosed here?\n ");
scanf("%s", branch);
printf("So finally tell me the year you took admission here\n");
scanf("%d",yearofadmission);
printf(" %s is doing his engineering in %s with specialisation in %s and he will rock the college placement record of %d" , myname, collegename, branch, yearofadmission);
return 0;
} -
Please the space not affiche in the char variable like tap ("my name is ....") output of this ("my")..
char color[10];
printf("What is your favorite color ?\n");
scanf("%s", &color);
printf("Your favorite color is : %s\n", color);
system("PAUSE");
return 0; -
its an amazing program
-
3:07 yes i wanna smash my crush
-
when I try to to read in user input, it does not give what the person is typing as yours does. How do I fix this?
-
53 made me rofl
-
#include <stdio.h>
#include <stdlib.h>
int main()
{
int a;
int b;
printf("what is your current income?\n");
scanf("%d", &a);
printf("how much money would you like to make?\n");
scanf("%d", &b);
int c = b-a;
printf("to reach your goal you have to make %d more", &c);
return 0;
}
for some reason it doesnt do the right math where did i go wrong? -
hi there Bucky
thanks for the videos
I tried this out, and would like to know how do I get the %d * %d to show up as the result, not as the equation
#include <stdio.h>
#include <stdlib.h>
int main()
{
char FirstName[20];
char LastName[20];
char WhatAreYouLearning[30];
int HoursADay;
int ForHowManyDays;
printf("what is your First name? \n");
scanf("%s", FirstName);
printf("what is your Last name? \n");
scanf("%s", LastName);
printf("what Are You Learning? \n");
scanf("%s", WhatAreYouLearning);
printf("How Many Hours A Day? \n");
scanf("%d", &HoursADay);
printf("For How Many More Days? \n");
scanf("%d", &ForHowManyDays);
printf("%s %s could in %d*%d Hours do some fun stuff with %s ", FirstName, LastName, HoursADay, ForHowManyDays, WhatAreYouLearning );
return 0;
} -
Thanks, you explained in 7 minutes what took me a whole day to understand through a text book.
-
scanf("%d", %numberOfbabies); I can't write % In front of numberOfbabies if i write it it doesn't work any idea !! :/
-
why did he not use of & in other statements?
anyone can explain it -
what plugin or setting are you using to highlight the word "name" on the whole program, it looks really helpful
7m 38sLenght
725Rating