Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 3)
- a)
- #include<stdio.h>
- int main()
- {
- int a, b, i, temp;
- scanf("%d %d", &a, &b);
- if(b % a == 0) printf("Sao Multiplos\n");
- else printf("Nao sao Multiplos\n");
- return 0;
- }
- b)
- #include<stdio.h>
- int main()
- {
- char str[40], st[40];
- gets(str);
- gets(st);
- printf("%s %s\n", str, st);
- return 0;
- }
- c)
- #include<stdio.h>
- #include<string.h>
- int main()
- {
- int i, len, count = 0, count2 =0;
- char str[40];
- gets(str);
- len = strlen(str);
- for(i = 0; i < len; i++)
- {
- if(str[i] == 'A' || str[i] == 'E' || str[i] == 'I' || str[i] == 'O' || str[i] == 'U') count++;
- if ((str[i] >= 'B' && str[i] <= 'Z')&&(str[i] != 'A' || str[i] != 'E' || str[i] != 'I' || str[i] != 'O' || str[i] != 'U')) count2++;
- }
- printf("%d Vowels and %d Consonants\n", count, count2);
- return 0;
- }
- d)
- #include<stdio.h>
- int main()
- {
- double c[] = {10,20,30,40,50};
- double f[5];
- int i;
- for(i = 0; i < 5; i++)
- {
- f[i] = ((9/5)*c[i]) +32;
- }
- for(i = 0; i < 5; i++)
- {
- printf("%0.1lf ", f[i]);
- }
- printf("\n");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement