Skip to main content

Posts

#primenumber #givennumberprimeornot CHECK THE GIVEN NUMBER IS PRIME OR N...

Problem Description This program takes a number and checks whether a given number is prime or not. Problem Solution 1. Take a number as input. 2. Check if the number is divisible by any of the natural numbers starting from 2. 3. If it is, then it is not a prime number. Otherwise it is a prime number. 4. Exit. Program/Source Code Here is source code of the C program to check if a given number is prime. The C program is successfully compiled and run on a Linux system. The program output is also shown below. /* * C program to check whether a given number is prime or not * and output the given number with suitable message. */ #include #include void main() { int num, j, flag; printf("Enter a number \n"); scanf("%d", &num); if (num <= 1) { printf("%d is not a prime numbers \n", num); exit(1); } flag = 0; for (j = 2; j <= num / 2; j++) { if ((num % j) =

#PATTERN #SYMBOLPRINT #ALPHABET How to print alphabet symbols print in j...

Number Pattern Programs In Java : Java programs to print the numbers or any other symbols in different patterns are one of the frequently asked interview programs mostly for freshers.  Because, they test the candidate’s logical ability as well as coding skills which are ‘must have  skills’ for any software engineer. In this post, I have collected some of the different number pattern programs in java and have tried to solve them. I hope they will be helpful for you guys. Number Pattern Programs In Java Pattern  1 : 1 1 2 1 2 3 1 2 3 4 1 2 3 4 5 1 2 3 4 5 6 1 2 3 4 5 6 7   Java Program : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 import java.util.Scanner; public class MainClass { public static void main(String[] args) { Scanner sc = new Scanner(System.in); //Taking rows value from the user System.out.println("How many rows you w

#AddingDigitOfgivenNumber #sumOFgivenDigit || How to add given number di...

C programming is a stepping stone for many programmers in the programming world. C is best to learn internals of programming and know how a computer program works internally. Since it is close to low level programming. Programming in C can be a nightmare for beginners if not practiced properly. However, you can learn and practice at Codeforwin step by step. In this programming exercise we will focus on basics of C programming. After completing this exercise you will learn basic structure and semantics of a C program and how to write mathematical programs in C. If you are not a beginner, still reached here. Hold your breath I am sure you will find these exercises interesting. Always feel free to drop your questions in comments section. I love to hear hugs and bugs from you all. Required knowledge Operators, Data types, Variables and expression, Basic input/output List of basic programming exercises Write a C program to perform input/output of all basic data types. Write

#SortingArrayElement #sorting #ArraySorting #erprince SORT THE ARRAY EL...

Java interview Question to sorting the Array element's See you are new to java or i might have suggested you to use Hash Map or other Collection classes. So lets forget it but look don't be in hurry to print the elements first sort them. And as you are having its name associated with it you have to also take care of the same. So first find the number of lines in the file and then allocate that much space to array but for 2 arrays take 1 array for storing names another for storing values suppose you got number of element in variable size so String[] name = new String[size]; int[] value = new int[size]; This will save memory or else you can set anything default Then one by one pick it from file and place it by splitting. But remember you will get values in String so you have to parse to get int here it goes get is a string array value[i] = Integer.parseInt(get[i]); value[i] = Integer.parseInt(get[i].trim());// If it wont work then string might be not t

2019 09 27 at 20 23 26

How to get job very easily and fast way (#Er prince kumar). Visit the Jo...

How to Get a job Very Easily. you have do something for your job. You have a lot's of platform are there. maybe your current job just isn’t working out, or maybe you just graduated and are trying to get employed for the first time. The job market can be hard to crack in either case, no matter your age or experience. Start by networking and searching online for job openings, tailoring your resume and cover letter to match what employers are seeking, and then sending in stand-out applications. The process may seem daunting, but going in with determination and a plan will carry you through until you find the perfect opportunity. # I am prince kumar .   Hopefully, all of your hard work results in an interview. If you get asked to come in, take time to prepare. Make sure to have examples ready to explain your past accomplishments and how you can help the company. For example, you could say, “I know you’re looking for a fresh take on how to increase sales. I’d love to tell you ab