Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main(){
- int n, i;
- printf("Enter the number of elements: ");
- scanf("%d", &n);
- int a[n], b[n], c[n];
- printf("Enter the elements of array a: ");
- for(i = 0; i < n; i++){
- scanf("%d", &a[i]);
- }
- printf("Enter the elements of array b: ");
- for(i = 0; i < n; i++){
- scanf("%d", &b[i]);
- }
- for(i = 0; i < n; i++){
- c[i] = a[i] + b[i];
- }
- printf("The result is: \n");
- for(i = 0; i < n; i++){
- printf("c[%d] = %d\n", i, c[i]);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment