#include <stdio.h>
int main(){
int i;
for( i =0 ; i >= /<= something ; i++/i--){
do somthing
} }
#include <stdio.h>
int main(){
int a=1;
while(a){
do someting;
a--;
} }
#include <stdio.h>
int/void func(int a/void);
int/void main(){
int a,b;
b = func(a);
}
int/void func(int k){
do someting;
}
#include <stdio.h>
int func(int z);
int main(){
int x=4,y;
y = func(int y);
}
int func(int z){
do somting...;
}
|
from
|
function name
|
what it do
|
|
#include <stdio.h>
|
printf("%d",num);
|
מדפיס למסך את המשתנה
|
|
scanf("%d",&num);
|
קולט לתוך המשתנה מספר מהמשתמש
|
|
|
#include <math.h>
|
pow(num,2);
|
מעלה את נאם בחזקת 2
|
|
sqrt(double(x));
|
שורש עבור איקס
|
|
מחזור
|
num
|
max
|
|
1
|
5
|
5
|
|
2
|
2
|
5
|
|
3
|
8
|
5
|
|
4
|
6
|
8
|
|
5
|
0
|
8
|
static void Main(string[] args)
{
for (int y = 1; y <= 10; y++)
{
for (int x = 1; x <= 10; x++)
{
Console.Write("{0,4}", x * y);
}
Console.WriteLine();
}
}
#include<stdio.h>
int check_prime(int a);
main()
{
int n, result;
printf("Enter an integer to check whether it is prime or not.\n");
scanf("%d",&n);
result = check_prime(n);
if ( result == 1 )
printf("%d is prime.\n", n);
else
printf("%d isn't prime.\n", n);
return 0;
}
int check_prime(int a)
{
int c;
for ( c = 2 ; c <= a - 1 ; c++ )
{
if ( a%c == 0 )
return 0;
}
if ( c == a )
return 1;
}
No comments yet.
Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.