answersLogoWhite

0

No, it is a function. But printf does return a value: the number of characters it has written.

User Avatar

Wiki User

13y ago

What else can I help you with?

Related Questions

What does return value of 0 from printf mean?

A return value of 0 from the printf function in C indicates that the function executed successfully and all characters were written to the output stream without any errors. If printf encounters an error during execution, it will return a negative value. It's important to check this return value when debugging or validating that output was generated as expected.


What does a return value of zero from printf mean?

empty format-string.


What is the ASCII value of white space in c language?

int main (void) { printf ("space is %d\n", ' '); return 0; }


Calculate length of string using printf statement only?

printf does return the length: size_t len = printf ("%s", str);


How do you write a C program to implement stacks through arrays?

#include<stdio.h> #include<conio.h> #define MAX 10 typedef struct stack { int item[MAX]; int Top; }stk; void createstack(stk *); void push(stk *,int); int pop(stk *); int isempty(stk *); int isfull(stk *); int main() { int choice; int value; stk s; createstack(&s); do{ clrscr(); printf("\n\t Main Menu"); printf("\n1. Push"); printf("\n2. Pop"); printf("\n3. Exit"); printf("\nEnter your choice="); scanf("%d",choice); switch(choice) { case 1: printf("\nEnter the value to be inserted="); scanf("%d",value); push(&s,value); getch(); break; case 2: value=pop(&s); if (value==0) printf("\n Underflow: Stack is empty"); else printf("\n Popped Element is %d",value) getch(); break; case 3: exit(); defualt: printf("\nInvalid choice"); } }while(1); return 0; } void createstack(stk *s) { s->Top=-1; } void push(stk *s,int element) { if(isfull(s)) { printf("\nOverflow: Stack is full"); return; } s->Top++; s->item[s->Top]=element; printf("\nValue is pushed onto the stack"); } int pop(stk *) { int popped; if (isempty(s)) return 0; popped=s->item[s-.Top]; s->Top-; return popped; } int isempty(stk *) { return s->Top==-1; } int isfull(stk *) { return s->Top==MAX-1; }


What is a purpose of printf and scanf statements?

we write printf() b/c it printf or show us the value contained in a value on the screen after pressing ctrl+f9.


Can you use nested printf?

printf ("nested printf returned %d\n", printf ("inner printf\n"));


What does printf and scanf return?

Printf returned no. of character receive . scanf return no of variable to be inputed according to format specifier . eg: i=printf("thisisc") printf("%d",i); //i=7 j=scanf("dd",&a,&b,&c,&d); printf("%d",j); IT IS MOST APPROPRIATE ANSWER FOR THIS Q .......... PLZ DO Practically............


Wap for swapping values of two variables using pointers as arguments to functions?

# include<stdio.h> # include<conio.h> void main() { clrscr(); int a,b; printf ("Enter the first value:"); scanf ("%d",& a ); printf ("Enter the second value:"); scanf ("%d",& b ); printf ("\n\nBefor swaping the values "); printf ("\nThe first value is %d",a); printf ("\nThe second value is %d",b); printf ("\n\nAfter swaping the values "); printf ("\nThe first value is %d",b); printf ("\nThe second value is %d",a); }


How do you write a program in C that variables change value with each other?

void main() { //variable declaration int a; int b; printf("\n Enter the first value"); scanf("%d",&a); printf("\n Enter the second value"); scanf("%d",&b); a=a+b; b=a-b; a=a-b; printf("\n After swap the value"); printf("\n value of A=%d",a); printf("\n value of A=%d",b); getch(); }


Where the printf statements are stored in memory?

Try this: #include <stdio.h> int main (void) { printf ("printf is at location %p\n", (void *)printf); printf ("main is at location %p\n", (void *)main); return 0; }


What is a Menu driven program for a stack operation?

#include#include#include#define MAXSIZE 50int a[MAXSIZE];int top=-1;void main(){int choice;void push();int pop();void display();clrscr();do{printf("\nYou can do following operations on stack\n");printf("\n1. Push");printf("\n2. Pop");printf("\n3. Display");printf("\n4. Exit");printf("\n Enter your choice");scanf("%d",&choice);switch(choice){case 1: push();break;case 2: pop();break;case 3: display();break;case 4: break;default: printf("\n Wrong input");}}while(choice!=4);getch();}void push(){int value;if(top==MAXSIZE-1){printf("\n Stack is overflow");}else{printf("\n Enter the value which you want to insert");scanf("%d",&value);top++;a[top]=value;}}int pop(){int value;if(top==-1){printf("\nStack is underflow");return(0);}else{value=a[top];top--;}return value;}void display(){int i;if(top==-1){printf("\n Stack is underflow");}else{for(i=top;i>=0;i--){printf("\n%d",a[i]);}}}#include < stdio.h >#include < conio.h >#define MAX 10int stack[MAX],top;void main(){char ch;int choice,item;void display();int pop();void push(int);clrscr();top=-1;do{printf("1.Insertion");printf("\n2.Deletion");printf("\n3.Display");printf("\nEnter your choice(1-3):");scanf("%d",&choice);switch(choice){case 1: printf("\nEnter the item to be inserted:");scanf("%d",&item);push(item);display();break;case 2: item=pop();printf("\nThe item deleted is %d",item);display();break;case 3: display();break;default:printf("Wrong choice");break;}printf("\nDo you want to continue(y/n):");fflush(stdin);scanf("%c",&ch);}while(ch=='y' ch=='Y');getch();}void push(int item){if(top==MAX-1){printf("Stack Overflow");return;}top=top+1;stack[top]=item;}int pop(){int t;if(top==-1){printf("Stack Underflow");return -1;}t=stack[top];top=top-1;return t;}void display(){int i;printf("\nThe Stack elements are:");for(i=0;i < =top;i++)printf("%5d",stack[i]);}