UrbanPro

Learn C Language from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

What is the output of the below: int x, y; printf("%d", scanf("%d %d", &x, &Y));

Asked by Last Modified  

Follow 1
Answer

Please enter your answer

"8 years experienced tutor (C, C++, Mathematics, Computer science)" by passion & "CCNA certified Python developer on Cisco network security platforms" by profession. Good with C, C++, Python, PyATS, Core Java, Networking, Linux, MCSE.

:) Good one. It checks my eye sight. This piece of code would result in an error: "undefined symbol Y". Note: 'scanf( )' not only scans and loads the values entered by users into variables, but it also returns a number which is the count of the number of variables that are successfully scanned by...
read more
:) Good one. It checks my eye sight. This piece of code would result in an error: "undefined symbol Y". Note: 'scanf( )' not only scans and loads the values entered by users into variables, but it also returns a number which is the count of the number of variables that are successfully scanned by itself. So, in this example if the upper case 'Y' in 'scanf( )' is replaced with lower case 'y', the scanf( ) would return 2 on successfully scanning the input values (say 10 and 20) to memory. read less
Comments

Tutor

Answer will no of variable read by scanf that is "2". and please make sure "Y" is not capital, because C is case sensitive language
Comments

Experienced IT Professional with 5 years of experience in Tutoring Programming subjects

scanf is used for reading inputs from the user. So user will be prompted to enter 2 integer numbers. scanf returns the number of successfully read inputs. suppose I entered 15 20 printf is used to prints the value of the variables or value returned by any function. In our case it will print the...
read more
scanf is used for reading inputs from the user. So user will be prompted to enter 2 integer numbers. scanf returns the number of successfully read inputs. suppose I entered 15 20 printf is used to prints the value of the variables or value returned by any function. In our case it will print the output or return value of the scanf function which will be 2. So complete output will be: 15 20 2 read less
Comments

Tutor

Output is 2. why? ans. printf function will count the number of variables that has been scanned because you specify %d which refers to integer.
Comments

Are you looking for an Expert Friendly Tutor?

2
Comments

Tutor

It would not compile at the very first. So, there is no scope to run this program. Conclusion is, it would not print anything on the output window.
Comments

Tutor

It would not compile at very first. So, there is no scope to run this code. Finally, it would not print anything on the output window.
Comments

Python trainer

Hi Pravalika, First thing is you should not ask questions like this (o/p of program etc..), as you can always verify with any compiler you use. You should always ask questions like why such thing..? (Ex. you can ask why the o/p of above program is 5?) Thanks, Janardhan.
Comments

First of all writing such code is not valid but still output concern it is 2, because scanf is library function and it have two parameters
Comments

Trainer

2
Comments

View 48 more Answers

Related Questions

Can an array be an lvalue?
The answer to this question is no, because an array is composed of several separate array elements that cannot be treated as a whole for assignment purposes. The following statement is therefore illegal:...
Vinodha
How to enroll for the course?
register here then post your requirements,do provide your ph no by which trainers can contact you or you can individually search for trainers nearest to your location and contact them.
Alpana
Can one new to programming learn Java, C, or other languages first?
First you can learn C language because it is Mother of all the all advanced language. then we can learn c++,Java,.NET, because all advanced language syntax is inherits from C language. If u r basic is good then u can learn every advanced language.
Agastya
0 0
5
Which are the best books to learn C?
- Yashwant Kanetkar - E Balagurusamy
Kratika
Why do we still use C language?
What is the C Language? The C language is a high-level, general-purpose programming language. It provides a straightforward, consistent, powerful interface for programming systems. That's why the C language...
Aditi
0 0
5

Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com

Ask a Question

Related Lessons

Pro learners tip for C language
First get the concept of algorithm before heading to write your first program.

Swapping variable contents using C
/* WAP to swap the content of variables using C*/ //Header files #include<stdio.h>#include<conio.h> //Main function void main(){ //Variable declaration of type integer int a,b,c; //function...
S

Bit wise operators in C
Bit Wise Operators Bit Wise operators are manipulates of individual bits with in a word of memory. The bit wise operators can be divided in to three general category. One’s Complement...

Why C is a Language and not a database?
When I interviewed a candidate, I raised this question many times, but I have not got the answer correctly. To under why C is a language and not a database, it is good to understand why our communication...

Programming Practice Technique
Any Programming Language required an Algorithm. Algorithm - It is the finite set of instructions in which each and every instruction has the meaning, instructions are not ambiguous and all the instructions...

Recommended Articles

Brilliant Academy is one of the reputed institutes for B.Tech tuition classes. This institute is specialised in delivering quality tuition classes for B.E, Engineering - all streams and Engineering diploma courses. Incorporated in 2012, Brillant Academy is a brainchild of Mr Jagadeesh. The main motto of the academy is to...

Read full article >

Lasya Infotech is a Hyderabad based IT training institute founded in 2016 by O Venkat. Believing in his innovation, passion and persistence and with a diverse blend of experience, he started his brainchild to deliver exemplary professional courses to aspiring candidates by honing their skills. Ever since the institute envisions...

Read full article >

Whether it was the Internet Era of 90s or the Big Data Era of today, Information Technology (IT) has given birth to several lucrative career options for many. Though there will not be a “significant" increase in demand for IT professionals in 2014 as compared to 2013, a “steady” demand for IT professionals is rest assured...

Read full article >

Almost all of us, inside the pocket, bag or on the table have a mobile phone, out of which 90% of us have a smartphone. The technology is advancing rapidly. When it comes to mobile phones, people today want much more than just making phone calls and playing games on the go. People now want instant access to all their business...

Read full article >

Looking for C Language Classes?

Learn from the Best Tutors on UrbanPro

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you
X

Looking for C Language Classes?

The best tutors for C Language Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn C Language with the Best Tutors

The best Tutors for C Language Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more