print a "hello" word without using printf n puts in c language

Answer Posted / anil h m

#include <stdio.h>
int main() {
char *p = "Welcome to C!
";
long l = 14;
long fd = 1;
long syscall = 1;
long ret = 0;
__asm__ ( "syscall"
: "=a" (ret)
: "a" (syscall),
"D" (fd),
"S" (p),
"d" (l)
);
return 0;
}

Is This Answer Correct ?    0 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do you mean by c?

589


How is actual parameter different from the formal parameter?

591


What is the data segment that is followed by c?

613


Dont ansi function prototypes render lint obsolete?

606


What are the 4 types of unions?

610






An expression to whose value an operater is applied a) operand b) variable c) constant d) all of the above

658


What is the use of structure padding in c?

563


What are c identifiers?

629


Explain what is the best way to comment out a section of code that contains comments?

722


What is variable initialization and why is it important?

621


Write a program to replace n bits from the position p of the bit representation of an inputted character x with the one's complement. Method invertBit takes 3 parameters x as input character, p as position and n as the number of positions from p. Replace n bits from pth position in 8 bit character x. Then return the characters by inverting the bits.

3691


if p is a string contained in a string?

1406


what is the different bitween abap and abap-hr?

1743


Explain the term printf() and scanf() used in c language?

597


How can I call system when parameters (filenames, etc.) Of the executed command arent known until run time?

594