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

How is C++ language used nowadays?
C++ is a fast and strongly-typed programming language which makes it an ideal choice for developing operating systems. Mac OS X has large amounts written in C++. Most of the software from Microsoft like...
Arumugam
0 0
5
How do I get 6 power 13 in c language?
#include <stdio.h> #include <math.h> int main() { double result = pow(6, 13); printf("6 to the power of 13 is: %f ", result); return 0; }
Raju
0 0
6
Is it better to bitshift a value than to multiply by 2?
yes in bitshifting operation, u know the shifting position of bit
Nadare
0 0
5
How can you check to see whether a symbol is defined?
You can use the #ifdef and #ifndef preprocessor directives to check whether a symbol has been defined (#ifdef) or whether it has not been defined (#ifndef).
Name
Why does execution of a program in C/C++/Java start from only main?
Main function is calling the other functions of he program and compiler gets this direction while Compiling the code. If it does not find main function then it will also not find the other functions in the code. So, main is required in C program.
Isha

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

Ask a Question

Related Lessons

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...

Everything about printf in C language
What is printf and from where it comes from in C code.? You must have used printf so many times in your Car programs but do you really know everything about printf? Let's see. What is the full form...

How to write shared library program using C Programming?
Library Name : hellofilename : hello.c#include void Hello(){ printf("Hello World .. How are you 1\n");}======================================Header File:hello.h#ifndef __HELLO_H#define __HELLO_Hvoid Hello(void);#endif===============================Application...

Basics Of C And C++
C++ is powerful, highly flexible, and adaptable programming language that allows software engineers to organise and process information quickly and effectively. But this high-level language is relatively...

Software Development Training In Jaipur
Satyam Web Solution provides website designing &development and software designing &development training in Jaipur for various stream’s students. MCA 6 month Industrial Training/Internship B....

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