Posts

Showing posts from June, 2020

why Chinese hacker ???

Image
India 6th most targeted by Chinese hackers since 2016. The cyber army exists but within China there are not many reports about them. The cyber army has three kind of targets - activists they need to shut down , overseas businesses companies for their IP (intellectual property) and governments for expanding influence. #cyberdefense #hacking #cybersecurityawareness

sum of digit of a number in c

Image
#include<stdio.h> int main() {     int digit, temp, output = 0;     printf("input : ");     scanf("%d", &temp);     while(temp>0){         digit = temp%10;         output = output + digit;         temp = temp/10;     }     printf("output : %d", output); } OUTPUT : testcase 1 - input : 11 testcase 2 - input : 123

how to print all prime number between intervals in c ?

#include<stdio.h> int main() {     int low, high, flag;     int i;     //take inputs     printf("enter intervals: ");     scanf("%d%d", &low, &high);     // start loop for starting value to ending value     while(low<high){         // update value of flag         flag = 0;         // ignore value which less the 2         if(low < 2){             ++low;             continue;         }         // logic for check prime number         for(i = 2; i<= low/2; ++i){             if(low % i == 0){                 flag = 1;                 break;  ...

how to check prime number in c ?

#include<stdio.h> int main() {     int num, i, flag = 0;     printf("enter number");     scanf("%d", &num);     for(i = 2; i<= num/2; ++i){         if(num%i == 0){             flag = 1;             break;         }     }     if(num == 1) {         printf("number is not prime");     }else {         if(flag == 0){             printf("%d number is prime number", num);         } else{             printf("%d number is not a prime number", num);         }     } } . . . . Follow on Instagram :  technicalflow Link:  https://instagram.com/technicalflow?igshid=158oh5ri58tti Link:  https://technical2k20.blogspot.com #technolog...