char S;
char S[6]= " HELLO";
printf("%s ",S[6]);

output of the above program ?
(0, ASCII 0, I,unpredictable)

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

we need to calculating INCOME TAX for the person. The INCOME TAX is as follows:- First $10000/- of income : 4% tax Next $10000/- of income : 8% tax Next $10000/- of income : 11.5% tax above $10, 00,00/- : 15% tax What is the Solution of this Question ?

807


How can I do peek and poke in c?

623


A banker has a seif with a cipher. Not to forget the cipher, he wants to write it coded as following: each digit to be replaced with the difference of 9 with the current digit. The banker chose a cipher. Decipher it knowing the cipher starts with a digit different than 9. I need to write a program that takes the cipher from the keyboard and prints the new cipher. I thought of the following: Take the input from the keyboard and put it into a string or an array. Go through the object with a for and for each digit other than the first, substract it from 9 and add it to another variable. Print the new variable. Theoretically I thought of it but I don't know much C. Could you give me any kind of hint, whether I am on the right track or not?

1516


Differentiate between functions getch() and getche().

627


The difference between printf and fprintf is ?

720






How can I manipulate strings of multibyte characters?

643


why do some people write if(0 == x) instead of if(x == 0)?

658


What is the time and space complexities of merge sort and when is it preferred over quick sort?

678


how we can make 3d venturing graphics on outer interface

4019


What is static memory allocation?

611


How to write a program for machine which is connected with server for that server automatically wants to catch the time for user of that machine?

1594


Why can't I perform arithmetic on a void* pointer?

639


How can you pass an array to a function by value?

609


What is ctrl c called?

601


Is null a keyword in c?

741