vinayakapuram said:
program1 :1
main()
{
printf("trip" "trapas");
}
output:trip traps
prog 2:
main()
{
prinf(5+ "bangalore");
}
output:lore
prog: 3
main()
{
n=5;
printf("\n n=%*d",n,n);
}
output:5
You've gotten a lot of criticism for this post. Let me explain why.
You put the question in the Subject: header. Not all news reading
software displays the subject header in a convenient manner. You need
to put the question in the body of the message as well.
Silly abbreviations like "u" for "you" and "y" for "why" are frowned
upon here. They make your writing very difficult to read, especially
for those whose native language isn't English. Minor spelling and
grammatical errors are ok, especially if English isn't *your* native
language, but please take the time to spell out the words. Standard
punctuation and capitalization are also very helpful.
The code you posted is not the same as the code that you compiled.
The first one doesn't produce the same output you say it does, the
second one misspells "printf" as "prinf", and the third doesn't
declare "n". All of them are missing the required
"#include <stdio.h>", and all of them should declare main as
"int main(void)" and have a "return 0" at the end.
You need to copy-and-paste the *exact* code that you fed to the
compiler rather than re-typing it. If you want help, don't make us
guess which errors were in your original code and which were
introduced when you re-typed it.
It's all about taking just a little extra effort to make it easier for
us to help you.
As for your questions:
1. Adjacent string literals are concatenated by the compiler.
2. A string literal represents an array. In most contexts, it's
implicitly converted to a pointer. You then perform pointer
arithmetic on the result. See section 6 of the comp.lang.c FAQ,
at <
http://c-faq.com/>. (See the rest of it, too.)
3. Read the documentation for the printf function.