answersLogoWhite

0


Best Answer

printf is declared in stdio.h

Format specifier for an integer value is %d.

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Can you declare printf for integer variable?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

How would you write Visual Basic Code to declare an Integer variable called intNumber?

Dim intNumber As Integer


What is main function of printf in a C program?

The syntax for printf is: int printf(const char *format, ...); Simple usage examples: 1. Print character literal: printf("%c", 'a'); 2. Print character variable: printf("%c", my_char); 3. Print string literal: printf("%s", "hello world"); 4. Print string variable: printf("%s", my_string); 5. Print integer variable: printf("%d", my_integer); 6. Print floating-point variable: printf("%f", my_float);


C program to find address of variable?

// Use the & operator (Sometimes called the "address of" operator int variable = 7; printf("Address of variable = %d\n", &variable); printf("Value of variable = %d\n", variable);


C code on Reversing integer array elements using temporary variable?

#include <stdio.h> int main() { int number, temp; printf("enter the number"); scanf("%d",&number); printf("\n reverse of %d",number); while(number>0) { temp=temp*10+number%10; number=number/10; } printf(" is %d",temp); }


Write four different c statement that each add 1 to ineger variable?

i++ i=i+1 ++i i+=1 but remember the answers of i++ and ++i are not be same.. use the following program to take closer look of the values of integer 'i'. thanks, Happy Garcha UFV, Abbotsford, Canada #include<stdio.h> main() { int i; printf(" i =>%d",i); i++; printf(" i++=> %d",i); ++i; printf(" ++i => %d",i); i=i+1; printf(" i=i+1 =>%d",i); i+=1; printf(" i=+1 =>%d",i); getch(); }

Related questions

How do you declare an integer?

datatype variable name;


How would you write Visual Basic Code to declare an Integer variable called intNumber?

Dim intNumber As Integer


What is used to declare variables in Visual Basic?

declaration of variable is dim a as integer


Why not simply put the decimal integer into the original string as compared to the format specifier?

You can certainly do that ... printf ("This is a number: 12345\n"); ... but that does not have the same value as placing the value in a variable and converting the variable into a string ... int i = 12345; printf ("This is a number: %d\n", i); That's the whole point of format specifiers - to initiate a conversion from one place to another.


What is main function of printf in a C program?

The syntax for printf is: int printf(const char *format, ...); Simple usage examples: 1. Print character literal: printf("%c", 'a'); 2. Print character variable: printf("%c", my_char); 3. Print string literal: printf("%s", "hello world"); 4. Print string variable: printf("%s", my_string); 5. Print integer variable: printf("%d", my_integer); 6. Print floating-point variable: printf("%f", my_float);


What is variable definition in c language?

variable definition means to declare the variable with its value. for example:- int i=10; this statement is a combination of declaration of integer i and assign its value to it,so it is a definition statement Note: assigning a value is not essential.


C program to find address of variable?

// Use the & operator (Sometimes called the "address of" operator int variable = 7; printf("Address of variable = %d\n", &variable); printf("Value of variable = %d\n", variable);


What is puts in c language?

printf("%s",variable);


What is the code required to convert an integer variable to a string variable in Java?

There are several different methods to convert an integer variable to a string variable in Java. For example, one can use the following code to convert an integer variable to a string variable: Integer.toString(number)


C code on Reversing integer array elements using temporary variable?

#include <stdio.h> int main() { int number, temp; printf("enter the number"); scanf("%d",&number); printf("\n reverse of %d",number); while(number>0) { temp=temp*10+number%10; number=number/10; } printf(" is %d",temp); }


(variable) = 34?

Integer


Write four different c statement that each add 1 to ineger variable?

i++ i=i+1 ++i i+=1 but remember the answers of i++ and ++i are not be same.. use the following program to take closer look of the values of integer 'i'. thanks, Happy Garcha UFV, Abbotsford, Canada #include<stdio.h> main() { int i; printf(" i =>%d",i); i++; printf(" i++=> %d",i); ++i; printf(" ++i => %d",i); i=i+1; printf(" i=i+1 =>%d",i); i+=1; printf(" i=+1 =>%d",i); getch(); }