Aptitude Question:
Download Questions PDF

What is the o/p of the following C-program?
Main()
{
Char str[7]="strings";
Printf("%s",str);
}

Answer:

This problem doesnt cause any kind of error!!! this is really tricky.. the size of the string "strings" is 7 but it terminates with a char. thus causing the total size to 8.

here in this case some abserd value will come as an output..

if the size of the array is less than 7 then it ll give the error " too many initilization"

and if the size is more than7 then the output ll be perfect and "strings"

Download Aptitude Interview Questions And Answers PDF

Previous QuestionNext Question
Jalia is twice older than qurban. If jalia was 4 years younger, Qurban was 3 years older their difference between their ages is 12 years. What is the sum of their ages?

a) 67
b) 57
c) 36
d) none
A man ate 100 bananas in five days, each day eating 6 more than the previous day. How many bananas did he eat on the first day?