C language interview questions solution for freshers beginners placement tricky good pointers answers explanation operators data types arrays structures functions recursion preprocessors looping file handling strings switch case if else printf advance linux objective mcq faq online written test prime numbers Armstrong Fibonacci series factorial palindrome code programs examples on c++ tutorials and pdf
Data types interview questions and
answers with explanation
Note: Size of data types in C is compiler-dependent. The answers provided are based on compilers with a word size of two bytes. Please adjust the answers according to the size of data types in your compiler. In this context:
char: 1 byte
int: 2 bytes
float: 4 bytes
double: 8 bytes
This information is crucial for interpreting and adjusting the answers based on the specific characteristics of your compiler.
Really thanks 4 providing such a huge range of beyond imagination quests.. Thanks a lot... @Admin: jz an advice for options of answers use radiobutton group instead.. because multiple answers are getting selected of same quest and they arent getting unchecked also..
hey anonymous i googled n got the answer for ur above question.. here it is....
Cyclic nature of data type in C In C some data types shows one special properties that when we assign a value beyond range of that data type then it will not any compiler error but assign a number according to some cyclic order. This property is known as cyclic nature of data type. Data type which shows cyclic nature: (a) char (b) int (c) long int Data type which doesn’t show cyclic nature: (a) float (b) double (c) long double
1. Cyclic nature of unsigned char: Range of unsigned char is 0 to 255. If we will assign a value greater than 255 then value of variable will be changed to a value if we will move clockwise direction as shown in the figure according to number. If number is less than 0 then move in anti clockwise direction.
Short cut formula to find cyclic value: If number is X where X is greater than 255 then New value = X % 256 If number is Y where Y is less than 0 then New value = 256 – (Y% 256)
2. Cyclic nature of signed char:
Range of unsigned char is -128 to 127. If we will assign a value greater than 127 then value of variable will be changed to a value if we will move clockwise direction as shown in the figure according to number. If number is less than -128 then move in anti clockwise direction.
Short cut formula to find cyclic value: If number is X where X is greater than 127 then p = X % 256 if p <=127 New value = p else New value = p – 256 If number is Y where Y is less than -128 then p = Y % 256 If p <= 127 New value = -p else New value = 256 -p
what is the output of this program....and also explain it..how the answer it comes main() { int a, b, c; a = 10; b = 20; c = printf("%d",a) + ++b; printf ("%d",c); }
here the reason is real numbers are stored in IEEE 754 format so the bit fields for float fills out to be 32 bit ie..a where as the bit fields for 0.7 which by default acts as double which is of 64 bits when you try to compare a will be lesser than 0.7 because the a is type casted implicitly which implicitly becomes 8 bytes .for further details look at memory representation of real numbers.
why because char constant consider a int so what it showing 4 bytes for example the capital value of A equivalent int value is 65(int) if u going to print both is same printf(sizeof('A'));
11. What will be output when you will execute following c code?
#include int main(){ volatile int a=11; printf("%d",a); return 0; }
i have executed this code on GCC compiler and i am getting the output as 11. but in the explanation of this code it is written that compiler can not predict the volatile variable.. why it is so ... please clear my doubt.
define array. How will you do the following?: 1. declare array 2. Initialize array 3. Enter data in array 4. Access elements of an array 5. Get output from an array. --- - -- - and - --- - - Write a program to add two 3*3 matrix using array.
Thank you for sharing such a wonderful article! It provides excellent and helpful pieces of information. It's great that you are taking the time to share your expertise with others. Please continue writing articles that can be useful to readers like myself who may not be aware of some of these tips and tricks! Data Science Training in Hyderabad Data Science Course in Hyderabad
I just want to let you know that I am a beginner to blog and of course I have enjoyed your web page. What is an Indian Business Visa? Indian Business Visa is an electronic business travel authorization. Apply for Indian business e-visa online through the Indian Visa website, and the cost for the Indian business e-Visa depending on the traveler's nationality and the urgency of the visa required by the traveller.
A degree in cybersecurity will most certainly require that additional courses be taken. Additionally, thought will need to be given with respect to the funds required for those additional courses and the resulting degree. UMBC Cybersecurity Courses List
Looking for a hotel in Mathura Vrindavan? We offer affordable accommodations and a variety of amenities to make your stay with us comfortable and enjoyable. Book your room today! Mathura Vrindavan Hotel Booking
Asset Plus Buyers Agents is the perfect choice if you're looking for the best buyers agent near me. We're a team of experienced professionals dedicated to helping you find the ideal property. We'll work with you to find the right property, negotiate the best price, and help you through the entire process. Contact us today, and let us help you find your dream property. Buyers agent near me
Are you looking for the best Online Piano Lessons Near Me in sydney, Australia? Our highly experienced and certified instructors offer lessons for all levels, from beginner to advanced. We also offer a wide range of styles, from classical to pop to jazz.
Are you looking for the Best Luxury Home Builders in Melbourne, Australia? Bullseye Home Builders are the experts in high-end home construction, focusing on quality craftsmanship and innovative design. We build homes that are not only beautiful and luxurious but also functional and liveable.
Are you looking for a professional Wallpaper Installation in Melbourne, Australia? Divine Interiors offers a wide range of wallpaper installation services to suit your needs. We have a team of experienced and qualified wallpaper installers who can do the job quickly and efficiently. Contact us today for a free quote.
Are you looking for an Online Hacking Course in Hindi? Cyberpratibha offers a comprehensive course that will teach you everything you need to know about hacking. With over 50 hours of content, you will learn the basics of hacking, how to protect yourself from hackers, and how to use hacking to your advantage.
¡Gran post sobre tipos de datos en C! Como desarrollador, también trabajo con APK Mod App en Android y veo muchas similitudes en la gestión de memoria. ¡Sigue así!
76 comments:
nice
thanks itz really good
Really thanks 4 providing such a huge range of beyond imagination quests.. Thanks a lot...
@Admin: jz an advice for options of answers use radiobutton group instead.. because multiple answers are getting selected of same quest and they arent getting unchecked also..
for question 1 output is 8 4 1.
can u provide solution to que:4
How i present 0123 as integer variable.
Marvelous...Very useful to me....My grateful thanks to you......................
hey where can i find a pdf of all these questions ?
its very useful to me,,,,,,,,,,,,,,,,thanks
Plz Clear Question No.14 because what is -6. signed char range is 0 to -128 to 127
hey anonymous i googled n got the answer for ur above question.. here it is....
Cyclic nature of data type in C
In C some data types shows one special properties that when we assign a value beyond range of that data type then it will not any compiler error but assign a number according to some cyclic order. This property is known as cyclic nature of data type.
Data type which shows cyclic nature:
(a) char
(b) int
(c) long int
Data type which doesn’t show cyclic nature:
(a) float
(b) double
(c) long double
1. Cyclic nature of unsigned char:
Range of unsigned char is 0 to 255. If we will assign a value greater than 255 then value of variable will be changed to a value if we will move clockwise direction as shown in the figure according to number. If number is less than 0 then move in anti clockwise direction.
Short cut formula to find cyclic value:
If number is X where X is greater than 255 then
New value = X % 256
If number is Y where Y is less than 0 then
New value = 256 – (Y% 256)
2. Cyclic nature of signed char:
Range of unsigned char is -128 to 127. If we will assign a value greater than 127 then value of variable will be changed to a value if we will move clockwise direction as shown in the figure according to number. If number is less than -128 then move in anti clockwise direction.
Short cut formula to find cyclic value:
If number is X where X is greater than 127 then
p = X % 256
if p <=127
New value = p
else
New value = p – 256
If number is Y where Y is less than -128 then
p = Y % 256
If p <= 127
New value = -p
else
New value = 256 -p
My name Ayesha
I hope this link will help you.
Cyclic nature of data types
very nice
you can test your c skills
where did you get int's size is 2, it is 4 byte.
very nice
this test is amesign cncept
nice exercises!! learned a lot of new things!!
nice really.. njoy it...
Can anyone explain the output of program as under:
#include
int array[]={1,2,3,4,5,6,7,8};
#define SIZE (sizeof(array)/sizeof(int))
main()
{
if(-1<=SIZE) printf("1");
else printf("2");
}
what is the output of this program....and also explain it..how the answer it comes
main()
{
int a, b, c;
a = 10;
b = 20;
c = printf("%d",a) + ++b;
printf ("%d",c);
}
i think the output will be 31..because here we used pre increment operation for b
i.e.,10+21=31.
or else the output will be 1023
2
#include
#include
void main()
{
float a=0.7;
if(a<0.7)
printf("stoned");
else
printf("Avenged");
}
plz reply what is the ans
here the reason is real numbers are stored in IEEE 754 format so the bit fields for float fills out to be 32 bit ie..a
where as the bit fields for 0.7 which by default acts as double which is of 64 bits when you try to compare a will be lesser than 0.7 because the a is type casted implicitly which implicitly becomes 8 bytes .for further details look at memory representation of real numbers.
2+21=23
because printf("%d",a) results 2 because a= 10 has two digits ..
Explain how its output is 1023
bro how you created this quizz and can you tell me which site u used to create this quiz :)
good knowledge of quiz thanks..
the solution is 8 4 2
please explane me this the output is 1 7
#include
int x = 0;
int main()
{
int i = (f() + g()) | g(); //bitwise or
int j = g() | (f() + g()); //bitwise or
printf("%d",i);
printf("%d",j);
}
int f()
{
if (x == 0)
return x + 1;
else
return x - 1;
}
int g()
{
return x++;
}
why is 8 4 2? more precisely why is ..2 instead 1(char : 1 byte)
why because char constant consider a int so what it showing 4 bytes for example the capital value of A equivalent int value is 65(int) if u going to print both is same
printf(sizeof('A'));
printf(sizeof(65));
very useful for all beginers
in tubo c int's size is 2
11.
What will be output when you will execute following c code?
#include
int main(){
volatile int a=11;
printf("%d",a);
return 0;
}
i have executed this code on GCC compiler and i am getting the output as 11.
but in the explanation of this code it is written that compiler can not predict the volatile variable.. why it is so ... please clear my doubt.
What are the various stage of programming development ?
Explain different tools for program logic development.
Why are flow-charts used? Explain symbols for making a flow chart-charts?
What are main programming characteristics?
What are various methods of compiling a C program?
Write a C program to find the largest of three numbers.
Write a note on operator in C.
what are statement different types in C? Explain all three iterative statement with syntax.
define array. How will you do the following?:
1. declare array
2. Initialize array
3. Enter data in array
4. Access elements of an array
5. Get output from an array.
--- - -- - and - --- - -
Write a program to add two 3*3 matrix using array.
best question of c language:-
Question:- Define function. What are advantage of using functions? how are functions.
8 4 2 is the output
main can be written as var name
thanks for this question
in qstn no 13 how we get z=y+1 ??
write a program that input two number and finds if second number is square of 1st number
please solve this program plz
write a program that input two number and finds if second number is square of 1st number
please solve this program plz
awesome
Great post
Gud post,please add data structure mcq type questions n answer.
Really nice and interesting post. I was looking for this kind of information and enjoyed reading this one. Keep posting. Thanks for sharing.
digital marketing courses in hyderabad with placement
I think I have never seen such blogs before that have completed things with all the details which I want. So kindly update this ever for us.
digital marketing courses in hyderabad with placement
Excellent effort to make this blog more wonderful and attractive.
digital marketing courses in hyderabad with placement
Thanks for sharing this article. Keep sharing some more blogs again soon.
ai training in hyderabad
Thanks for sharing this blog with us. I hope the below link is useful for data science enthusiasts.
Best Data Science Training Hyderabad
Thank you for sharing such a wonderful article! It provides excellent and helpful pieces of information. It's great that you are taking the time to share your expertise with others. Please continue writing articles that can be useful to readers like myself who may not be aware of some of these tips and tricks!
Data Science Training in Hyderabad
Data Science Course in Hyderabad
I like the helpful content and as always keep us updated and posted. Share your info with us please.
Data Science Training in Hyderabad
Data Science Course in Hyderabad
Your blog has so many great articles. I was impressed by the great job you have done with the way each topic is presented in your writing.
AWS Training in Hyderabad
AWS Course in Hyderabad
Nice post. it is very good question of data topic. I'm impressed! Extremely useful information. Thank you and keep up the good work. whatsapp mod
Thank You for this interview questions. I will remember this. Hope you will support same in future..
GBWhatsapp APK 2022
I just want to let you know that I am a beginner to blog and of course I have enjoyed your web page. What is an Indian Business Visa? Indian Business Visa is an electronic business travel authorization. Apply for Indian business e-visa online through the Indian Visa website, and the cost for the Indian business e-Visa depending on the traveler's nationality and the urgency of the visa required by the traveller.
A degree in cybersecurity will most certainly require that additional courses be taken. Additionally, thought will need to be given with respect to the funds required for those additional courses and the resulting degree. UMBC Cybersecurity Courses List
Looking for a hotel in Mathura Vrindavan? We offer affordable accommodations and a variety of amenities to make your stay with us comfortable and enjoyable. Book your room today! Mathura Vrindavan Hotel Booking
Asset Plus Buyers Agents is the perfect choice if you're looking for the best buyers agent near me. We're a team of experienced professionals dedicated to helping you find the ideal property. We'll work with you to find the right property, negotiate the best price, and help you through the entire process. Contact us today, and let us help you find your dream property. Buyers agent near me
Are you looking for the best Online Piano Lessons Near Me in sydney, Australia? Our highly experienced and certified instructors offer lessons for all levels, from beginner to advanced. We also offer a wide range of styles, from classical to pop to jazz.
Are you looking for the Best Luxury Home Builders in Melbourne, Australia? Bullseye Home Builders are the experts in high-end home construction, focusing on quality craftsmanship and innovative design. We build homes that are not only beautiful and luxurious but also functional and liveable.
Are you looking for a professional Wallpaper Installation in Melbourne, Australia? Divine Interiors offers a wide range of wallpaper installation services to suit your needs. We have a team of experienced and qualified wallpaper installers who can do the job quickly and efficiently. Contact us today for a free quote.
Are you looking for an Online Hacking Course in Hindi? Cyberpratibha offers a comprehensive course that will teach you everything you need to know about hacking. With over 50 hours of content, you will learn the basics of hacking, how to protect yourself from hackers, and how to use hacking to your advantage.
Fantastic article with valuable information found it very useful looking forward to the next blog thank you.
https://espirittech.com/delphi-development/
This is a great post I saw, thanks for sharing. I really want to hope that you will continue to share great posts in the future.
Delphi Development Services
Delphi Development Company
¡Gran post sobre tipos de datos en C! Como desarrollador, también trabajo con APK Mod App en Android y veo muchas similitudes en la gestión de memoria. ¡Sigue así!
Post a Comment