Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- *2a*
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- int suma;
- for(int i=100; i<=9999; i++)
- {
- if(i%5!=0 && i%3!=0)
- {
- suma+=i;
- }
- }
- printf("Suma to: %d", suma);
- return 0;
- }
- *2b*
- #include <stdio.h>
- #include <stdlib.h>
- float ciag(int n){
- if(n==1) return 1;
- if(n==2) return 2;
- if(n==3) return 3;
- if(n>3)return (ciag(n-1)+ciag(n-2)+ciag(n-3))/3;
- }
- int main()
- {
- for(int i=1; i<10; i++)
- {
- printf("%f ", ciag(i));
- }
- }
- *2c*
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement