1) Why array index start with always 0 ?
5) Whar are the diff approches of lang?
6)Diff bet while and for?
7) diff between if and switch?
8)why main() is starting point of programe?
9)how dyanamic array is declared?
10)Structure of file?
11) Array Decalration?
12) what is purpose of { braket?
13) if u have 10 diff bottals having 10gm marbal in it writing of prog for it?
14) sort 10000 people array with optimized way?
15) if u have 2 dics and u want show all month date into that write program for it?
16) what are the data types supported by switch() ?
17)demo for if,while,for?
18) if we have array of 30 int sort it
condi:
1) u cant declare another array
2)u cant use more than 5 variable
20) jvm memory how can be distributed
21)whar are the diff algo used to garbage collection?
Ques.1 - You are working on critical mission project, as a part of the project,it is required to write a function in c which accept two co-ordinates(x1,y1) for a given point p, you need to determine which quadrant given point belongs, e.g. (10,15)(both are positive hence it in Quadrant I,where as point(-10,15) in Quadrant II. In all the there are nine possibilities as given below:
I Quadrant,II Quadrant,III Quadrant, IV Quadrant, +X Axis, -ve X Axis, +Y Axis, -Y Axis and Origin(0,0).
Unfortunately compiler on your computer has developed strange behaviour, it can't compile any conditional statements like If........then else,switch.....case, therefore you can't write any conditional statement. It is very urgent that we need to write the function and can't wait for your compiler to get fixed. Write program /function in c or VB which will accept 2 co-ordinates and return one of the 9 possible values given above. Please remember that you can't write any conditional statement in your function/program.
23) diff between smartphone and feature phone
The index of array, which is of the form a[i], is converted by the compiler in the form [a+i]. So, the index of first element is zero because [a+0] will give 'a' & the first array element
can be accessed.
2) How to create a header file in C & C++?
3) Write a program to swap two numbers without using a temporary variable.
Swapping interchanges the values of two given variables.
Logic:
step1: x=x+y;
step2: y=x-y;
step3: x=x-y;
step1: x=x+y;
step2: y=x-y;
step3: x=x-y;
Example:
if x=7 and y=4
step1: x=7+4=11;
step2: y=11-4=7;
step3: x=11-7=4;
if x=7 and y=4
step1: x=7+4=11;
step2: y=11-4=7;
step3: x=11-7=4;
Thus the values of the variables x and y are interchanged.
Program:
#include <stdio.h>
int main() {
int a, b;
printf("Enter values of a and b: \n");
scanf("%d %d", &a, &b);
printf("Before swapping a=%d, b=%d\n", a,b);
/*Swapping logic */
a = a + b;
b = a - b;
a = a - b;
printf("After swapping a=%d b=%d\n", a, b);
return 0;
}
Output:
Enter values of a and b: 2 3
Before swapping a=2, b=3
The values after swapping are a=3 b=2
int main() {
int a, b;
printf("Enter values of a and b: \n");
scanf("%d %d", &a, &b);
printf("Before swapping a=%d, b=%d\n", a,b);
/*Swapping logic */
a = a + b;
b = a - b;
a = a - b;
printf("After swapping a=%d b=%d\n", a, b);
return 0;
}
Output:
Enter values of a and b: 2 3
Before swapping a=2, b=3
The values after swapping are a=3 b=2
4) find max int number within without using conditional stmt in c?
int getMax(int a, int b) {
int c = a - b;
int k = (c >> 31) & 0x1;
int max = a - k * c;
return max;
}
5) Whar are the diff approches of lang?
6)Diff bet while and for?
7) diff between if and switch?
8)why main() is starting point of programe?
9)how dyanamic array is declared?
10)Structure of file?
11) Array Decalration?
12) what is purpose of { braket?
13) if u have 10 diff bottals having 10gm marbal in it writing of prog for it?
14) sort 10000 people array with optimized way?
15) if u have 2 dics and u want show all month date into that write program for it?
16) what are the data types supported by switch() ?
17)demo for if,while,for?
18) if we have array of 30 int sort it
condi:
1) u cant declare another array
2)u cant use more than 5 variable
20) jvm memory how can be distributed
21)whar are the diff algo used to garbage collection?
22) PROGRAMMING LANGUAGES
Ques.1 - You are working on critical mission project, as a part of the project,it is required to write a function in c which accept two co-ordinates(x1,y1) for a given point p, you need to determine which quadrant given point belongs, e.g. (10,15)(both are positive hence it in Quadrant I,where as point(-10,15) in Quadrant II. In all the there are nine possibilities as given below:
I Quadrant,II Quadrant,III Quadrant, IV Quadrant, +X Axis, -ve X Axis, +Y Axis, -Y Axis and Origin(0,0).
Unfortunately compiler on your computer has developed strange behaviour, it can't compile any conditional statements like If........then else,switch.....case, therefore you can't write any conditional statement. It is very urgent that we need to write the function and can't wait for your compiler to get fixed. Write program /function in c or VB which will accept 2 co-ordinates and return one of the 9 possible values given above. Please remember that you can't write any conditional statement in your function/program.
23) diff between smartphone and feature phone
No comments:
Post a Comment