C problems for beginner

10 numbers from the keyboard and find their sum and average

Write a program in C to read 10 numbers from the keyboard and find their sum and average

Write a program in C to read 10 numbers from the keyboard and find their sum and average Solution in C: #include<stdio.h> void main() { int i,n,sum=0 ;double aver=0; printf(“enter the number:”); scanf(“%d”,&n); for(i=1;i<=10;i++){ sum=sum+i; aver=sum/(double)10; } printf(“The sum of 10 no is :%d\n”,sum); printf(“The Average is :%lf”,aver); return 0; } This code is a …

Write a program in C to read 10 numbers from the keyboard and find their sum and average Read More »

sum of first n natural numbers in c

Write a program sum of first n natural numbers in C.

Write a program sum of first n natural numbers in C. #include<stdio.h> void main () { int i,n ,sum= 0; scanf(“%d”,&n); printf(“The first 7 natural is:”,n); for(int i=1;i<=7;i++) { printf(“%d “,i); sum=sum+i; } printf(“\nThe Sum of Natural Number upto 7 terms : %d”,sum); return 0; } Write a program in C to display the first …

Write a program sum of first n natural numbers in C. Read More »

Write a program in C to display the first 10 natural numbers

Write a program in C to display the first 10 natural numbers.

Example 1.Write a program in C to display the first 10 natural numbers. #include<stdio.h> void main () { int i,n; scanf(“%d”,&n); printf(“The first 10 natural numbers are: “,n); for(int i=1; i<=n;i++) { printf(“%d “,i); } } When you run this code, it will output the numbers 1 through 10 separated by spaces. The loop will …

Write a program in C to display the first 10 natural numbers. Read More »

Array in C Programming

Searching for a Value in an Array in C Programming

Searching for a Value in an Array in C Programming Programming languages are used to communicate with computers and to create software applications. C programming language is one of the most popular programming languages used for system programming, embedded systems, and game development. One of the essential aspects of programming is searching for values in …

Searching for a Value in an Array in C Programming Read More »

Array in C Programming

A Beginner’s Guide to Understanding C Programming Basics-3

C Programming Basics Problems for Beginners 1. Generating a series of numbers and calculating their sum in V Generating like 9 99 999 9999 99999 and there sum #include <stdio.h> void main() { long int n,i,t=9; int sum =0; printf(“Input the number or terms :”); scanf(“%d”,&n); for (i=1;i<=n;i++) { t=t*10+9; sum =sum+t; printf(“%d “,t); } …

A Beginner’s Guide to Understanding C Programming Basics-3 Read More »

Scroll to Top
NEW TOXIC ROCKET CYCLE DECK in Clash Royale 2023 Best Deck in Clash Royale Best Deck for Arena 8 in Clash Royale Best Hog deck for Pro players Best Clash Royale Deck