Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

why my code is not runnig , shows line 13 have error

0 votes
asked Aug 17, 2018 by subarna sahoo (120 points)
my_name = 'Subarna k. Sahoo'
my_age = 22 #not a lie
my_height = 66 # inches
my_weight = 75 # kg
my_eyes = 'blue'
my_teath = 'white'
my_hair = 'black'

print("let's talk about %s." % my_name)
print("He's %d inches tall." % my_height)
print("He's %d kgs heavy." % my_weight)
print("actually that's not  too heavy.")
print("he's got %s eyes and %s hair." %(blue, black))
print("His teeath are actually %d depending on the colgate." % my_teeth)

#this line is tricky, try to get it exactly right.
print("if I add %d, %d and %d, and %d." %(my_age, my_height, my_weight, my_age + my_height + my_weight))

2 Answers

+1 vote
answered Aug 18, 2018 by Ethan Alexander Lee (580 points)

First of all: 

print("he's got %s eyes and %s hair." %(blue, black))

Blue and Black aren't declared as variables, try using quote marks.

Secondly, try using .format.

```

my_name = 'Subarna k. Sahoo'
my_age = 22
my_height = 66
my_weight = 75
my_eyes = 'blue'
my_teeth = 'white'
my_hair = 'black'

print("Let's talk about {}.".format(my_name))
print("He's {} inches tall.".format(my_height))
print("He's {} kgs heavy.".format(my_weight))
print("Actually, that's not too heavy.")
print("He's got {} eyes and {} hair.".format(my_eyes, my_hair))
print("His teeth are actually {} depending on the colgate.".format(my_teeth))
print("If I add {}, {} and {}, I get {}.".format(my_age, my_height, my_weight, my_age + my_height + my_weight))
```

commented Aug 18, 2018 by Ethan Alexander Lee (580 points)
Teeth was misspelled as well.
0 votes
answered Aug 21, 2018 by anonymous
#include<stdio.h>

#include<conio.h>

void main()

{

int person details;

print("enter the name")

sacn("%d\n",name)

print("enter the age);

scan("%d\n",age)

print("enter the height ");

scan("%d\n",height)

print("enter the weight");

scan("%d\n",weight)

print("enter the eyes");

scan("%d\n",eyes)

print("enter the  teeth colur");

scan("d\n",teeth colur)

print("enter the hair colur");

scan("%d\n",hair style)

getch();
commented Aug 21, 2018 by anonymous
I think it is wrong but i try level best,and i'm not perfect in codeing and practice very well so,try this program now......
commented Aug 24, 2018 by Aditya Mudaliar (280 points)
there are alot off issues here,use char arrays for storing names and %s while taking input or printing them
use %d for integer variables while taking input and/or printing
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...