answersLogoWhite

0

What else can I help you with?

Continue Learning about Engineering

How do printf's format specifiers e and f differ in their treatment of floating-point numbers?

%e expects a corresponding argument of type double; %f expects a corresponding argument of type float.


C programming diamond shape for loops Problem and output sample is in the picture?

#include<stdio.h> main() { int i; for(i=1;i<=1;i++) { printf("*",i); } printf("\n"); for(i=1;i<=3;i++) { printf("*",i); } printf("\n"); for(i=1;i<=5;i++) { printf("*",i); } printf("\n"); for(i=1;i<=3;i++) { printf("*",i); } printf("\n"); for(i=1;i<=1;i++) { printf("*",i); } }


Is printf keyword?

== == What is printf in c or prototype of printf with example (q) What is prototype of printf function ? Explain each term. Ans: Prototype of printf function is : int printf( const char *format ,…) Explanation of each term : Parameter of printf function is : (three continuous dots) : It is called ellipsis. It indicates the variable number of arguments. Example of ellipsis: #include void ellipsis(int a,...); void main() { int a=5,b=10; clrscr(); ellipsis(a,b); getch(); } void ellipsis(int a,...) { printf("%d ",a); } Output:5 So printf function can have any number of variables as an argument.


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; }


How can you print percent d on the screen using printf?

printf("Your text here %d", your_data); or maybe you want to see '%d' as output? Try one of these: printf ("%%d"); printf ("%cd", '%'); printf ("%s", "%d"); fputs ("%d", stdout);

Related Questions

Syntax of printf?

I think you can use 'printf' like blew, int printf( const char *format [, argument]... );int _printf_l( const char *format, locale_t locale [, argument]... );int wprintf( const wchar_t *format [, argument]... );int _wprintf_l( const wchar_t *format, locale_t locale [, argument]... );at the same time, I give a example using the 'printf',/** * example using the 'printf' */include int main() { int e; int i; e = _set_printf_count_output( 1 ); printf( "%%n support was %sabled.\n", e ? "en" : "dis" ); printf( "%%n support is now %sabled.\n", _get_printf_count_output() ? "en" : "dis" ); printf( "12345%n6789\n", &i ); // %n format should set i to 5 printf( "i = %d\n", i ); }


How do printf's format specifiers e and f differ in their treatment of floating-point numbers?

%e expects a corresponding argument of type double; %f expects a corresponding argument of type float.


Which of the argument is not specified in the IF function?

A condition has to be specified. One or both of the True and False arguments can be left out, though you must place a comma after the condition.


How many ways to pass argument to functions in c?

One: list them between '(' and ')'. Example: printf ("argc=%d\n", argc);


Can you use nested printf?

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


C programming diamond shape for loops Problem and output sample is in the picture?

#include<stdio.h> main() { int i; for(i=1;i<=1;i++) { printf("*",i); } printf("\n"); for(i=1;i<=3;i++) { printf("*",i); } printf("\n"); for(i=1;i<=5;i++) { printf("*",i); } printf("\n"); for(i=1;i<=3;i++) { printf("*",i); } printf("\n"); for(i=1;i<=1;i++) { printf("*",i); } }


How do you create a calculator using c that tells you if the answer to your problem is even or odd?

Well, you'd start by actually coding the calculator part, but at the end, you would test the answer with something like:if(ans % 2 == 0) {printf("%d is even.", ans);} else {printf("%d is odd.", ans);}The percent sign in the if test is the modulo operator. It returns the remainder of dividing the former argument by the latter argument.


Is printf keyword?

== == What is printf in c or prototype of printf with example (q) What is prototype of printf function ? Explain each term. Ans: Prototype of printf function is : int printf( const char *format ,…) Explanation of each term : Parameter of printf function is : (three continuous dots) : It is called ellipsis. It indicates the variable number of arguments. Example of ellipsis: #include void ellipsis(int a,...); void main() { int a=5,b=10; clrscr(); ellipsis(a,b); getch(); } void ellipsis(int a,...) { printf("%d ",a); } Output:5 So printf function can have any number of variables as an argument.


Why we use percent you in c language?

%u is a printf format specifier that says to take the next argument and display it as an unsigned decimal number, assuming standard integer length.


Write a program to find the largest of three numbers and print the output in ascending order?

void main() { int a,b,c; clrscr(); printf("Enter the value of a:"); scanf("%d",&a); printf("\nEnter the value of b:"); scanf("%d",&b); printf("\nEnter the value of c:"); scanf("%d",&c); if(a>b) { if(a>c) { if(b>c) { printf("c is smallest\n"); printf("b is middle\n"); printf("a is largest\n"); } else { printf("b is smallest\n"); printf("c is middle\n"); printf("a is largest\n"); } } else { printf("b is smallest\n"); printf("a is middle\n"); printf("c is largest\n"); } } else if(b>c) { if(a>c) { printf("c is smallest\n"); printf("a is middle\n"); printf("b is largest\n"); } else { printf("a is smallest\n"); printf("c is middle\n"); printf("b is largest\n"); } } else { printf("a is smallest\n"); printf("b is middle\n"); printf("c is largest\n"); } getch(); }


What is printf function?

Printf function is used in c language. Printf is used to print something to the standard output. ex: printf ('welcome');


What is the prototype of printf function?

in stdio.h:extern int printf (const char *fmt, ...);