char S;
char S[6]= " HELLO";
printf("%s ",S[6]);
output of the above program ?
(0, ASCII 0, I,unpredictable)
Answers were Sorted based on User's Feedback
Answer / kiran kumar
For the Above Program u will get the Error as Conflictinf
types for S because you are declaring 2 variables of
different types one as char and another as char aray with
same names.
So, the compiler will be in Unpredicatable stage
variable name S to be consider for what type and it will
give Error as Confilctinf types for S.
Even if u replace any of the S with s then u will get the
Output of this Program as Segfault in Linux where as in
Windows u will get the HELLO.
To the Best of my Knowledge i Posted this Answer.
Let me Know if there is any better Clarifications.
My emai Id is kirjony@gmail.com
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / divakar & venkatesh
u will get the following error
conflicting types for 'S'
| Is This Answer Correct ? | 0 Yes | 1 No |
Answer / prasanth
IT`LL SHOW AS MULTIPLE DECLATION FOS S AND WE`LL NOT OBTAIN
THE OUTPUT
| Is This Answer Correct ? | 0 Yes | 2 No |
Answer / manishsoni
This gives an error, and prg is terminated.
To slove this problem we show a program..
#include<stdio.h>
#include<conio.h>
int main()
{
char S[6]= "HELLO";
printf("%s",S);
getch();
return 0;
}
this print simple hello.
| Is This Answer Correct ? | 0 Yes | 2 No |
How do you list a file’s date and time?
what is the advantage of function pointer
16 Answers CMC, CS, Freshdesk, L&T, LG Soft, Matrix, TCS,
Give the rules for variable declaration?
Read N characters in to an array . Use functions to do all problems and pass the address of array to function. 1. Print only the alphabets . If in upper case print in lower case vice versa.
What is enumerated data type in c?
write a C program: To search a file any word which starts with ?a?. If the word following this ?a? starts with a vowel.Then replace this ?a? with ?a? with ?an?. redirect with the output onto an output file.The source file and destination file are specified by the user int the command line.
What is openmp in c?
What is use of integral promotions in c?
What is the difference between new and malloc functions?
How do you convert a decimal number to its hexa-decimal equivalent.Give a C code to do the same
Write a program of advanced Fibonacci series.
Write a C program to multiply tho numbers without using arithmetic operator (+, -, *, /).