Share on Google+Share on Google+

siti umairah
printf and println
1 Answer(s)      6 years and 4 months ago
Posted in : Java Beginners

what is the differences between printf and println?

Ads

View Answers

December 8, 2010 at 4:45 PM


Hi Friend,

The println prints the text on a new line, where as printf prints the text on the same line.

Thanks










Related Tutorials/Questions & Answers:
printf and println
printf and println  what is the differences between printf and println?   Hi Friend, The println prints the text on a new line, where as printf prints the text on the same line. Thanks
For printing out strings, there are echo, print and printf. Explain the differences.
For printing out strings, there are echo, print and printf. Explain the differences.  For printing out strings, there are echo, print and printf. Explain the differences
Advertisements
Can u print in turbo c 9 8 7 6 5 4 3 2 1 0 using pre increment operator Only use print ++a in the same printf() command ten times)
Can u print in turbo c 9 8 7 6 5 4 3 2 1 0 using pre increment operator Only use print ++a in the same printf() command ten times)  Can u print... ++a in the same printf() command ten times
Can u print in turbo c 9 8 7 6 5 4 3 2 1 0 using pre increment operator Only use print ++a in the same printf() command ten times)
Can u print in turbo C  Can u print in turbo c 9 8 7 6 5 4 3 2 1 0 using pre increment operator Only use print ++a in the same printf() command ten times
3
java.io package  The java.io package includes a PrintStream class that has two formatting methods that we can use to replace print () and println...;The methods are printf() and format().These methods writes a formatted string
>, <
>, <  main() { float a=0.7; if(a<0.7) printf("lesser"); else printf("greater"); } Output: lesser main() { float a=1.2; if(a<1.2) printf("lesser"); else printf("greater"); } Output: greater HOW
Java IO PrintWriter
)   printf(Locale l, String format, Object... args) : This method... and arguments, to the writer. Syntax : public PrintWriter printf(Locale l, String format, Object... args)   printf(String format, Object... args) : This method
Tricky
Tricky  if() printf("Hello") else printf("world") what should be he condition such that o/p is both hello and world as helloworld
Convert To Java Program - Java Beginners
check(); void main() { int num; printf("\nMenu\n"); printf("1-Add\n"); printf("2-Delete\n"); printf("3-Insert\n"); printf("4-Display\n"); printf... add() { printf("Enter value: "); scanf("%d",&array[cntr]); cntr
program of c
program of c  write a program in c to display a to z without using printf or scanf statements or header files
c programe
++){ printf("%d",j); } for(int j = 0; j < 5-i; j++){ printf(" "); } for(int j=i;j>=1;j--){ printf("%d",j); } printf("\n"); getch(0
programs
programs  define SQ(x)x*x main() { int a=SQ(2+1); printf("%d
programs
programs  define SQ(x)x*x main() { int a=SQ(2+1); printf("%d
jan
jan  write code to input a word and printf the next consecutive letter of each alphabet input :EARTH output :FBSUI
C program - SQL
void main() { int i,j; int * pt; clrscr(); printf(" "); printf("\n...=&k; printf("%4d", *pt); } printf("\n"); } getch(); } Thanks
ANZ PLZ
ANZ PLZ  FIND DISCRIPTION ABOUT print () and println ()METHODS  ... the output: hellohi The println() method prints on a new line. It makes the cursor to be placed in the next line of the displayed command. For example: println
JSP - EJB
JSP scriptlet tag out println  What is the JSP scriptlet tag out println
java
java  what 2 access modifiers that can encapsulate the attributes of class?? and what is the concept of printf?   Hello Friend, Public and Private can encapsulate the attributes of class. Printf formats the strings
implementation of stacks using linked lists in c++
choice,data; clrscr(); while(1){ printf("\n1.Push\n2.Pop\n3.Display\n4.Exit\n"); printf("\nEnter ur choice:"); scanf("%d",&... *)malloc(sizeof(struct node)); printf("Enter a node data :"); scanf
C Program to Print Pascal Triangle - Development process
void main(){ int a[15][15],i,j,rows,num=25,k; printf("\n enter the number of rows:"); scanf("%d",&rows); for(i=0;i=0;k--) printf(" "); for(j=0;j<...]; } printf("%4d",a[i][j]); } printf("\n"); } getch(); } Thanks
Managment
); gotoxy(27,2); printf("SUFYAN COMPANY Pvt.(Ltd.)"); gotoxy(35,3); printf("MAIN MENU"); lin(1,80,4,205); gotoxy(28,7); printf("1. ADDITION OF RECORD"); gotoxy(28,8
Managment
); gotoxy(27,2); printf("SUFYAN COMPANY Pvt.(Ltd.)"); gotoxy(35,3); printf("MAIN MENU"); lin(1,80,4,205); gotoxy(28,7); printf("1. ADDITION OF RECORD"); gotoxy(28,8
Managment
); gotoxy(27,2); printf("SUFYAN COMPANY Pvt.(Ltd.)"); gotoxy(35,3); printf("MAIN MENU"); lin(1,80,4,205); gotoxy(28,7); printf("1. ADDITION OF RECORD"); gotoxy(28,8
Managment
); gotoxy(27,2); printf("SUFYAN COMPANY Pvt.(Ltd.)"); gotoxy(35,3); printf("MAIN MENU"); lin(1,80,4,205); gotoxy(28,7); printf("1. ADDITION OF RECORD"); gotoxy(28,8
Managment
); gotoxy(27,2); printf("SUFYAN COMPANY Pvt.(Ltd.)"); gotoxy(35,3); printf("MAIN MENU"); lin(1,80,4,205); gotoxy(28,7); printf("1. ADDITION OF RECORD"); gotoxy(28,8
goto statement problem. reply fast.
; clrscr(); rep : printf("\nEnter the value rs"); scanf("%f",&rs); p=rs*100; printf("\n\npaisa =%2.f ",p); printf("\n do you want...; char z='y'; clrscr(); while(z=='y') { printf("\nEnter
C Program to Print Stras - Development process
; int j=0; for(i=1;i<=4;i+=1){ printf("\n"); for(j=1;j<=i;j++) printf("*"); } printf("\n"); for(i=3;i>=0;i-=1){ for(j=0;j
Sum of array element in C
(); printf("Enter five elements for an array \n"); read(a,5); printf("The list elements are \n"); display(a,5); for(i=0;i<5;i++) { sum+=a[i]; } printf("The sum of the elements
C Program for Addtion of 2*2 Diagnol Matrix - Development process
],b[2][2],c[2][2],i,j; clrscr(); printf("Enter the First matrix:\n"); for(i=0;i<2;i++) { for(j=0;j<2;j++){ scanf("%d",&a[i][j]); } } printf("\nThe First matrix is:\n"); for(i=0;i<2;i++) { printf("\n"); for(j=0;j<2;j
C program - Java Magazine
: #include #include void main(){ int a,b,c,area,ar; clrscr(); printf("Enter first integer:\n"); scanf("%d", &a); printf("Enter second integer:\n"); scanf("%d", &b); printf("Enter third integer:\n"); scanf("%d
Push and Pop operation of stack.
) { *top = *top + 1; stack[*top] = value; printf("\nStack element should be less than four\n"); } else { printf("\nThe stack is full... - 1; } else { printf("\nThe stack is empty can not pop a value
Tutorials   
Java Spring Hibernate Struts Training Retrieve database from the table dynamically in jsp from oracle using servlet What does core Java include? java What are some way to learn Java quickly? Is it required to learn Java before learning Java Script? Is it necessary to learn java script before learning PHP? Are HTML5 and Java Script boosts Java career? Is Java object oriented? Fingerprint application with Java Uninstall Oracle Virtual Box JSON to HashMap Free Java online Training I want example of Control Statement in Java ANSI Color Codes with Python Create a Program that Calculates Input What is difference between JDK,JRE and JVM? How to see ubuntu version on server? How to get Page Source in Selenium (WebDriver) using Java? The path to the driver executable must be set by the webdriver.gecko.driver system property parse data from a link in java Java Program Qns using BlueJ How to fix HAX Kernel Module Is Not Installed error? Installing Audacity Looking for code Logic to check track changes & Coments in MSWord, MSWordx, MSExcel, MSExcelx is ON/OFF Installing JDK on Mac SAX Parser exception ERROR 601 (42P00): Syntax error. Encountered Thread java.lang.NoClassDefFoundError: org/apache/commons/fileupload/FileItemFactory How to install Ubuntu 16.04 LTS? HttpServletRequest cannot be resolved to a type in eclipse - Solved Unhandled event loop exception GC overhead limit exceeded Spring Data jpa with apache phoenix Caused by: java.lang.IllegalArgumentException: Not a host:port pair: PBUF o.a.h.h.z.RecoverableZooKeeper - Possibly transient ZooKeeper, quorum= com.thinkaurelius.titan.diskstorage.hbase.HBaseStoreManager class not found com.thinkaurelius.titan.diskstorage.hbase.HBaseStoreManager not found How to download and install Java 8 on Windows? How to uninstall JDK 7? How to install gtk-doc-tools package in Ubuntu? How to install Oracle JDK 8 on Ubuntu? ejabberd_ctl.beam not found - Solved How to convert date to UTC format in Java? How to install autoconf, automake and libtool in Ubuntu 15.10? How to convert current date to mm dd yyyy format in Java? How to convert current date to dd mm yyyy format in Java? How to stop window closing in "internalFrameClosing" event. How to find list of all index in Neo4j? neo4j-server.properties file location SASLError using PLAIN: not-authorized

Ads

 
Advertisement null

Ads