Doubt | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Doubt

Can I declare variables inside loop like int a=5 below Eg #include<stdio.h> int main(){ int i=0; for(i=0;i<2;i++) int a=5; printf("%d",a); }

30th Oct 2020, 9:38 AM
S.Brindha
S.Brindha  - avatar
1 Answer
+ 7
https://www.sololearn.com/learn/C/2927/ you can see here how to use for loop and assign the variables in it
30th Oct 2020, 10:03 AM
Aysha
Aysha - avatar