UrbanPro
true

Learn C Language from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

C Program-The Odd Loop Demo

Salim Ahmed Ansari
12/01/2017 0 1

/* WAP to print square value of the number entered by user using odd loop*/

//Header Files

#include<stdio.h>
#include<conio.h>

//Main Function

void main()
{
 char another='y';
 int num,sq;

// Function for clearing the screen

 clrscr();

// Odd Loop

 while(another=='y')
 {
  printf("Enter a number:");
  scanf("%d",&num);

  sq=num*num;
  printf("Square of %d is %d",num,sq);
  printf("\nWant to enter another number y/n:");
  scanf("%c",&another);
  another=getchar();
 }

//Function for holding the screen on console
 getch();
}

0 Dislike
Follow 2

Please Enter a comment

Submit

H

Hachishiki | 27/08/2018

Bro You are Awesome

0 0

Other Lessons for You

All About Programming And A Good Programmer.
Hi, This is my first lesson for you guys. Hope you enjoy reading it. In recent community questions, I found many people wanted to be good programmers, or wanted to have good hands on certain language,...

Why we need to learn Programming languages?
Language is medium for communication. If two parties like to communicate or exchange the thoughts they must know a language. Language should be understandable by both the Parties. For example A wants to...

C, Cpp, Java, Python, Javascript Programming Languages
Learning C is as good as Learning a Natural Language(such as English, Hindi, Telugu, Tamil etc) We use Natural Languages to communicate with humans whereas we use Programming Languages such as C, Cpp,...
V

Vamshi

0 0
0

Is It Fine To Write “void main()” Or “main()” In C/C++?
The definition: void main() { /* ... */ } Is not and never has been C++, nor has it even been C. See the ISO C++ standard 3.6.1 or the ISO C standard 5.1.2.2.1. A conforming...

Pointers Concept
Every variable has a memory location and every memory location has its address defined which can be accessed using ampersand (&) operator, which denotes an address in memory. Consider the following...
X

Looking for C Language Classes?

The best tutors for C Language Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn C Language with the Best Tutors

The best Tutors for C Language Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more