Showing posts with label Daily Questions. Show all posts
Showing posts with label Daily Questions. Show all posts
Saturday, 27 December 2014
Monday, 20 October 2014
C Program that calculates the Volume of the Sphere
Program:
#include<stdio.h>
#include<conio.h>
#define pi 3.14
void main( )
{
int r,
float v;
printf("\nEnter the radius of the Sphere:");
scanf("%d",&r);
v=(4/3)*pi*r*r*r;
printf("\nVolume of the Sphere is %f",v);
}
Input/Output:
Enter the radius of the Sphere:1
Volume of the Sphere is 4.082000
#include<stdio.h>
#include<conio.h>
#define pi 3.14
void main( )
{
int r,
float v;
printf("\nEnter the radius of the Sphere:");
scanf("%d",&r);
v=(4/3)*pi*r*r*r;
printf("\nVolume of the Sphere is %f",v);
}
Input/Output:
Enter the radius of the Sphere:1
Volume of the Sphere is 4.082000
Write a program to read three numbers from the user and find the highest number
Program:
#include<stdio.h>
#include<conio.h>
void main( )
{
int x,y,z,h;
clrscr( );
printf("\nEnter Three Numbers:");
scanf("%d%d%d",&x,&y,&z);
h=((x>y)&&(x>z))?x:(y>z)?y:z;
printf("\nHighest Number is %d",h);
getch( );
}
Input/Output:
Enter Three Numbers:10
20
30
Highest Number is 30
#include<stdio.h>
#include<conio.h>
void main( )
{
int x,y,z,h;
clrscr( );
printf("\nEnter Three Numbers:");
scanf("%d%d%d",&x,&y,&z);
h=((x>y)&&(x>z))?x:(y>z)?y:z;
printf("\nHighest Number is %d",h);
getch( );
}
Input/Output:
Enter Three Numbers:10
20
30
Highest Number is 30
Wednesday, 27 August 2014
What would be the output of the following following Program?
#include<conio.h>
void main( )
{
int a[ ] = {1,2,3,4,5};
printf("%u,%u,%u",&a,a,&a[0]);
}
Options:
A)65516,65518,65560
B)65516,65516,1
C)65516,1,1
D)65516,65516,65516
Answer
Option D)-->for example the base address of the array a is 65516.
-->a, &a are points to the base address of the array and &a[0] is points to the address of first element in the array i.e base address.
So, answer is 65516,65516,65516.
Tuesday, 26 August 2014
What is the Output of the following Program?
#include<stdio.h>
#include<conio.h>
void main( )
{
int x=10;
int y=11;
printf("%x,%d,%i,%x",x,x,x,y);
}
Options:
A)%x,10,10,%x
B)10,10,10,11
C)%x,10,%i,%x
D)a,10,10,bAnswer
Option D)-->%d and %i are used for integer datatype.
-->%x is used for hexadecimal notaion.
Number ---> HexaDecimal Value
1 ---> 1
2 ---> 2
3 ---> 3
4 ---> 4
5 ---> 5
6 ---> 6
7 ---> 7
8 ---> 8
9 ---> 9
10 ---> a
11 ---> b
12 ---> c
13 ---> d
14 ---> e
15 ---> f
Thursday, 21 August 2014
What would be the output of the following Program?
#include<stdio.h>
#include<conio.h>
void main( )
{
int i;
i = 999;
if(i = 5)
{
printf("You are Good");
}
else
{
printf("You are Perfect");
}
}
Options:
A)You are Perfect
B)You are Good
C)an error
D)none
Answer
Option B)Because i=5 is true statement
The purpose of the if statement is , if the condition is true then if block executed. Otherwise else block executed.
Wednesday, 20 August 2014
What is the output of the following Program?
#include<stdio.h>
#include<conio.h>
void main( )
{
char far *p1, *p2;
printf("%d,%d",sizeof(p1),sizeof(p2));
}
Options:
A)4,2
B)2,2
C)4,4
D) an error
Answer
Option A)-->A Pointer size is 2 bytes (for 16-bit compiler)
-->The size of far pointer is 4 bytes
-->The size of the huge pointer is 4 bytes
-->the far pointer is 16-bit segment value
-->the huge pointr is 16-bit offset value
Tuesday, 19 August 2014
Subscription
Popular Posts
-
Latest AMCAT practice papers: Download Now AMCAT Exam Pattern 2014 1) Quantitative Ability Section 2) Logical Ability Section ...
-
1) If the word " BOOK " is coded as " CPPL " then how to code the following words? i) MASTER ii) REASON ...
-
amazon is the one of the leading and big online shopping website. Even if it is leading or big online shopping website, it may have some...
-
Operators: The symbol is used to perform an operation is called an operator. --> An operator which expect only one operand is r...
-
Control Statements These statements are useful to decide which statements are executed and which statements are not to be executed ...
-
Strings A string is a group of characters enclosed in a curly braces or ends with a null character --> The null character is p...
-
Pointers Pointer is a variable which stores address of another variable. --> The syntax for declaring a pointer is as follows...
-
Glenwood Systems is one of the healthcare software development company. It is established in 1988 Interview Process: 1st Ro...
-
Selection Process: 1st Round For B-Tech(CSE/ECE/ECM) Students: Written Test - 44 bits(C/Aptitude/OS) Dur...
-
The Data what be store can be classify as follows. --> Variable is just a memory location which is capable of storing some dat...
Categories
- ACT
- ADP
- AMCAT
- Android
- Aptitude
- Array Programs
- Asked in AMCAT
- Asked in Global Edge
- Asked in Infosys
- Asked in Placements
- Asked in TCS
- Asked in Tech Mahindra
- Asked in Virtusa
- Basic I/O and Data Types
- C Language Tutorials
- C Programs
- Coding & Decoding
- Daily Questions
- Essential
- Fony Technologies
- Glenwood Systems
- Huawei
- Java Programs
- Java Script
- Mind Tree
- MiracleSoft
- Offcampus Placements
- Placement Papers
- Placements Questions
- PORTWARE
- Programs
- Search Programs
- Selection Process
- Smartphones
- Sort Algorithms
- String Manipulation Programs
- Structures
- Syntel
- TCS
- TCS Placement Papers
- Tech Tips
- Technical Questions
- Variables and Data Types
- Virtusa
- WhatsApp Features
- WhatsApp Tricks
- WIPRO
Powered by Blogger.





