Divisibility
Problem
You are provided an array A of size N that contains non-negative integers. Your task is to determine whether the number that is formed by selecting the last digit of all the N numbers is divisible by 10 .
C Solution:
- #include <stdio.h>
- int main(){
- int N = 0;
- char* ans="No";
- scanf("%d", &N);
- long data[N];
- for(auto i=0; i<N; i++)
- scanf("%ld", &data[i]);
- // write your code here
- for(int i=0;i<N;i++){
- if(data[i]%10==0)
- ans="Yes";
- else
- ans="No";
- }
- // ans =
- printf("%s", ans);
- return 0;
- }
Note:
We
Are Providing Every Content in this Blog Inspired From Many People and
Provide it Open To All People Who Are Willing Gain Some Stuff in
Computer Science.
Comment below👇 for Any Errors & Doubts.
Post a Comment
Post a Comment
Learn, Share and Enjoy