arduino reading string or integer

i am new to arduino,i’m trying to read string and integer from serial monitor(PC)

here is the code for integer:
void setup(){
pinMode(13,OUTPUT);
Serial.begin(9600);
}
void loop(){
if(Serial.available()>0){
int q=Serial.parseInt();
for(int i=0;i<q;i++){
digitalWrite(13,HIGH);
delay(66);
digitalWrite(13,LOW);
delay(66);
}
delay(1000);
}
}

and here is the code for string:

void setup(){
Serial.begin(9600);
}
void loop(){
if(Serial.available()>0){
String q=(String)Serial.read();
Serial.write(q);
}
}

So, what actually happens when you run the first code ?
What do you see, if anything, if you print q in the first example ?
What have you got the line ending set to in the Serial monitor ?
What baud rate have you got the Serial monitor set to ?
Is there something magic about the number 66 in the delay()s ?
Does the second example compile ?
Do you understand the difference between a string and a String ?
Why did you not put the code in code tags as requested in Read this before posting a programming question ... - Programming Questions - Arduino Forum which I assume that you read before posting your question.

The example sketch in this Thread may be of interest.

...R

Strings, integers, floating point! Here is a simple calculator that uses thee PC terminal to do math. Well documenter, using the newer parse instructions!

http://www.hackster.io/rayburne/scientific-calculator

Ray