# Results for: int

### 30 examples of variables?

int n1; int n2; int n3; int n4; int n5; int n6; int n7; int n8; int n9; int n10; int n11; int n12; int n13; int n14; int n15; int n16; int n17; int n18; int n19; int n20… Full Answer

### How do declare function pointer having two integer parameters and returning integer pointers?

// declare a function int* function(int, int); or int* (function)(int, int); // declare a pointer to a function int* (*pointer_to_function)(int, int);

### Write a Program to add subtract multiply and divide the two numbers?

public class Test { public int add(int a, int b) { return a + b; } public int sub(int a, int b){ return a - b; } public int mult(int a, int b){ return a * b; } public div(int… Full Answer

### Get size of int using sizeoff?

printf ("sizeof (int) = %d\n", (int)sizeof (int));

### C program to find LCMof three integers?

int LCM3 (int a, int b, int c) { return LCM2 (a, LCM2 (b, c)); } int LCM2 (int a, int b) { return a*b/GCD2(a, b); }

### What is functions returning pointers?

#include<iostream> using namespace std; main() { int * add(int,int); int *ptr; int x,y; cin>>x>>y; ptr=add(x,y);//address of the result variable is assigned to ptr cout<<"result is"<<*ptr; } int *add(int a,int b) { int c=a+b; return(&c); } #include<iostream> using namespace std; main()… Full Answer

### C plus plus prog a function sum that returns the sum of all Values in the given array int sum int list int arraySize?

int sum(int list[], int arraySize) { int sum=0; for(int i=0; i<arraySize; ++i ) sum+=list[i]; return(sum); }

### What is the difference between function and recursive function?

I will explain in the easiest way the difference between the function and recursive function in C language. Simple Answer is argument of the function is differ but in the recursive function it is same:) Explanation: Function int function(int,int)// function… Full Answer

### How do you make an array of 16?

In Java: int[] myArray; // or: int myArray[] followed by: myArray = new int[16]; Instead of int, you can use any other data type, including a class. In Java: int[] myArray; // or: int myArray[] followed by: myArray = new… Full Answer

### How do you declare an int array?

Here's are examples: int[] array; int array[]; int[] array = {1, 2, 3};

### Write a program to print elements of array using pointer?

#include <stdio.h> void printarr(int a[]); void printdetail(int a[]); main() { int a[5]; for (int i = 0;i<5;i++) { a[i]=i; } printdetail(a); } void printarr(int a[]) { for (int i = 0;i<5;i++) { printf("value in array %d\n" ,a[i]); } } void… Full Answer

### What is the Difference between normal int and regular int?

Are you sure that these words (normal int and regular int) actually mean something?

### What is the difference between short int and int?

It depends on the programming language, the compiler, and the machine architecture. In C, the size of short int and int is not mandated by the language. Often, on 32-bit machines, 'int' will be 32-bit, while 'short int' may be… Full Answer

### C plus plus prog a function min that returns the minimum of all Values in the given array int min int list int arraySize?

int min(int list[], int arraySize) { int min=arraySize?list[0]:0; for(int i=1; i<arraySize; ++i ) if(list[i]<min) m=list[i]; return(min); }

INT

### Int a is literal in C language or not?

int a; -- variable definition "int a" -- string literal

### How you assign int to short if s is short and i is int?

By type casting since int is of larger bits than short s=(int)i;

### What is earlier declaration for main?

pick one: int main (void); int main (int argc, char **argv); int main (int argc, char **argv, char **envp);

### How do you initialize an array variable in java program?

int size=10; int a[]=new Int[size]; this is static initialization; int aa[]=null; int size; size you can take from your applicatin aa[]=new int[size]; this is what dynamic initialization

### How do you get C programming to reduce a fraction?

#include "stdio.h" int gcd(int a, int b); void reduce(int* numerator, int* denominator); int main(int argc, char* argv[]) { int a, b; fscanf(stdin, "%d/%d", &a, &b); reduce(&a, &b); fprintf(stdout, "%d/%d", a, b); return 0; } int gcd(int a, int b) {… Full Answer

### Write a C program to find the smallest of three integers without using any of the comparision operators?

int smallest_positive(int a, int b, int c) { int s = 0; while (a && b && c) { s++; a--; b--; c--; } return s; // works only for positive integers } int smallest(int a, int b, int c)… Full Answer

### Write a c plus plus program to find largest among three number using control statement and ternary operators?

int max (int a, int b) { return a<b?b:a; } int max3 (int a, int b, int c) { return max (max (a, b), c); }

### What are basic data types in c?

basic data types in c language are: int(signed int) short int long int unsigned int char float double long double

### How i useStatic extern int a in c?

No such thing, pick one ot the three: static int x; extern int x; int x;

### Are Two methods cannot have the same name in Java?

Two methods can have the same name provided their method signatures are different. For ex: public int add(int a, int b, int c){ } public float add(float a, float b, float c){ } These two methods can co-exist in the… Full Answer

### Program for bubble sort using swap?

#include<stdio.h> #include<conio.h> int *bubble(int a[],int n); int *y; int j,i; void main() { int value[]={10,2,3,5,9,6,2,3,6,8}; int n; clrscr(); n=sizeof(value)/sizeof(int); y=bubble(value,n); for(i=0;i<n;i++) { printf("%d\n",*y++); } getch(); } int *bubble(int a[],int n) { int t; for(i=0;i<n-1;i++) { for(j=0;j<n-i;j++) { if(a[j]<=a[j+1]) { t=a[j]… Full Answer

### C program to add two matrices using pointers?

#include<stdio.h> #include<stdlib.h> int** addMatrices(int**,int**,int,int); int main() { int **a;int **a1;int **a2; int i,j,m,n; printf("Enter the number of rows and columns\n"); scanf("%d",&m); scanf("%d",&n); for(i=0;i<m;i++) { for(j=0;j<n;j++) { scanf("%d",&a[i][j]); } } for(i=0;i<m;i++) { for(j=0;j<n;j++) { scanf("%d",&a[i][j]); } } a2=addMatrices(**a,**a1,m,n); for(i=0;i<m;i++) { for(j=0;j<n;j++)… Full Answer

### How to transpose a 2 dimensional array?

public static void transpose(int[][] a, int[][] b, int width, int height) { for (int i = 0; i < width; i++) { for (int j = 0; j < height; j++) { b[j][i] = a[i][j]; } } } template <class… Full Answer

### How is main function declared?

int main (void) or int main(int a, char **p)

### What is call by value in c plus plus?

When we call a function in C++ by passing the values as arguments, it is called call by value. e.g #include<iostream.h> #include<conio.h> int add(int,int); int main() { int a,b,c; cout<<"Enter numbers."; cin>>a>>b; c=add(a,b); cout<<"Sum : "<<c; return 0; } int… Full Answer

### To find the addition and subtraction of 2 integer using call by refernce?

void math(int*, int*, int*, int*) void main() { int a, b, c, d; puts("ENTER VALUES TO A & B"); math(&a,&b,&c,&d); printf("sum= %d \n diff= %d", c,d); getch(); } void math( int*a, int*b, int*c, int*d) { *c= *a+*b; *d= *a-*b; }

### How do you write a program to find the largest number in an array in c plus plus?

int largest(int a[],int n) { int i; int l=a[0]; for (i=0;i<n;i++) if (a[i]>l) l=a[i]; cout<<l; }

### How do Write a program to swap one demensional array?

void swap(int array1[],int array2[],int numberOfElements) { for(int i=0;i<numberOfElements;i++){ int temp=array1[i];array1[i]=array2[i];array2[i]=temp;} }

### Write a C program to find greatest common divisor GCD of the given three number?

Just write a function that finds gcd of two numbers, then you are almost done: int gcd (int a, int b); int gcd3 (int a, int b, int c) { return gcd (gcd (a, b), c); }

### How do you write a c program to find largest of 3 numbers using pointers?

Find the largest of two, then find the largest of that value and the third value. int* max (int* a, int* b) { return (a*) > (b*) ? a : b; } int* max_of_three (int* a, int* b, int* c)… Full Answer

### What does int stand for?

The definition of .INT is interntional

### Write a program to multiply two polynomials using an array?

#include<stdio.h> #include<malloc.h> int* getpoly(int); void showpoly(int *,int); int* addpoly(int *,int,int *,int); int* mulpoly(int *,int,int *,int); int main(void) { int *p1,*p2,*p3,d1,d2,d3; /*get poly*/ printf("\nEnter the degree of the 1st polynomial:"); scanf("%d",&d1); p1=getpoly(d1); printf("\nEnter the degree of the 2nd polynomial:"); scanf("%d",&d2); p2=getpoly(d2)… Full Answer

### In c language size of data type int?

printf ("sizeof (int) is %d bytes", (int)sizeof (int)); Most likely it will be 2 or 4.

### How an unsigned int can be twice as large as the singed int?

For example: int i= 3; unsigned u= 6; int j= 32767; unsigned v= 65534;