This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int Age [] = {30, 22, 33, 44, 25}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int Age [5] = {30, 22, 33, 44, 25}; | |
int Age [5]; | |
Age [0]=30; | |
Age [1]=22; | |
Age [2]=33; | |
Age [3]=44; | |
Age [4]=25; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define NUM_EMPLOYEE 10 | |
int Age[NUM_EMPLOYEE]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <windows.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#define NUM_EMPLOYEE 10 | |
int main(int argc, char *argv[]) { | |
int Salary[NUM_EMPLOYEE], lCount=0, gCount=0, i=0; | |
printf( "Enter employee salary (Max 10)\n" ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while(low <= high) | |
{ | |
mid = (low + high) / 2; | |
if (target < list[mid]) { | |
high = mid - 1; | |
} | |
else if (target > list[mid]) { | |
low = mid + 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for(i=0; i < N; i++) | |
{ | |
for(j=0; j < N;j++) | |
{ | |
statement; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for(i=0; i < N; i++) | |
{ | |
some statement; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
we have to calculate the square of n | |
*/ | |
return n*n; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
we have to calculate the square of n | |
*/ | |
for i=1 to n | |
do n = n + n | |
// when the loop ends n will hold its square | |
return n |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* n is the length of array a[] */ | |
int sum(int a[], int n) | |
{ | |
int x = 0; // 4 bytes for x | |
for( int i = 0; i < n; i++ ) // 4 bytes for i | |
{ | |
x = x + a[i]; | |
} | |
return(x); | |
} |
NewerOlder